-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
handlr 0.12.0 completion scripts is faulty #89
Comments
What terminal shell are you using?
I am already aware of this and I plan to update the README.md soon. I just have not gotten around to doing so yet. Sorry if that caused any inconvenience. |
zsh and bash but I have replicated it with fish |
I can confirm that I can replicate this issue on my end. I'll look into it further a bit later. |
@R3G3N3R4T0R What's the version of the Arch package you are using, including the pkgrel number? |
0.12.0-2 |
Sorry about being slow to respond. What happens if you run the following?
|
I can understand being late, I am also quite busy lately.
zsh
fish
Of course adding handlr to it only printed the help page before the error and if I interpret it as loading those functions Something strange happened that the |
My bad, I meant to put
Strange. I can replicate this. I'll have to look into what's causing this.
It was fixed because you sourced the completion generated directly from In I'll continue trying to figure out a way to get |
I finally got around to fixing this in the
|
Can confirm
|
Sorry, totally missed I think I have narrowed down the cause of the issues with Now I need to figure out whether this issue is on my end or on |
So the bug is probably my fault. In any case, I think I fixed the completions in bash. Would you mind giving it a try on your system? Thank you for your patience and cooperation, by the way. |
It works on my system now, also checked zsh and fish with the 4 sub-commands to see if there is any regression (not that it is likely). I just realized the path completion is faulty though, basically clap-rs/clap/#5239, but I can replicate it on bash and zsh, only fish is immune. I am not sure how it reappeared when it is added to CI/CD and we are using clap 4.5. I do find it weird I am the only one reporting this though, maybe not many people use it directly? I often open apps from the shell instead of the file manager so I kinda have a stake in it, only if I know how to read code quickly. |
I am guessing that Or maybe the dynamic completions are unstable enough there are still significant holes in test coverage. In any case, I might have to issue a bug report.
I think those might be more issues with
That might be possible. To my understanding, users tend to mainly use Regardless, I am glad someone noticed it and reported it so that others with your use case no longer have to deal with it. |
@Anomalocaridid Thank you so much for fixing this! Can we get a new patch release with this fix? |
@The-Ludwig Sorry about that. I have made a new patch release. |
Just found that there is still issue with the completer when there is escaped characters. Very careless of me not to notice it, I am very sorry for that. I will have to check where the problem originate. From what I gather (on bash) from To give some example, I want to match a file "foo bar" and "foo foo" also exist in the directory, on bash and zsh
these complete nothing as the escapes are retained and the last one has I have found this stackoverflow question https://stackoverflow.com/questions/26509260/bash-tab-completion-with-spaces, and this open issue spf13/cobra#1740, probably have something to do with it but they both use compgen to process the completions afterwards. I am also just using the new tagged release from arch, though I don't think it has any problem, the absolute path fix also turned into a no-op so it should be the exact same as I compile myself. |
Current Behavior
The generated completer is faulty. For
open
andmime
subcommands it only complete options and will not complete paths, and completes nothing if the current word doesn't match the options. Forlaunch
andget
it only complete extensions, not options, and continues to do so after typing 2 dashes.The new created script also seems to hard code the path to
handlr
by prepending cwd to argv[0] unless argv[0] is not a path. If the completion script is generated before installation the path would be invalid and suppress the original completer. Might be better to document it in the README.Expected Behavior
It should generate completion for both options and paths/extensions. If a dash or 2 dashes are at the front of the completing word then it should complete options, and if
./
is at the front of the current word it should complete only paths.Distribution and Version
handlr version : 0.12.0
Distribution : Artix Linux using Arch Linux extra repository
I do not see any commit to the code after the tag release so I did not compile it myself.
The text was updated successfully, but these errors were encountered: