Anomalocaridid / handlr-regex

Fork of handlr with support for regex
MIT License
123 stars 5 forks source link

handlr 0.12.0 completion scripts is faulty #89

Open R3G3N3R4T0R opened 5 days ago

R3G3N3R4T0R commented 5 days ago

Current Behavior

The generated completer is faulty. For open and mime subcommands it only complete options and will not complete paths, and completes nothing if the current word doesn't match the options. For launch and get 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.

Anomalocaridid commented 4 days ago

What terminal shell are you using?

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.

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.

R3G3N3R4T0R commented 4 days ago

zsh and bash but I have replicated it with fish

Anomalocaridid commented 3 days ago

I can confirm that I can replicate this issue on my end. I'll look into it further a bit later.

Anomalocaridid commented 1 day ago

@R3G3N3R4T0R What's the version of the Arch package you are using, including the pkgrel number?

R3G3N3R4T0R commented 23 hours ago

0.12.0-2 0.12.0-1 to 0.12.0-2 should just be renaming the command in completion files. I don't know about 0.12.0 without pkgrel. I have also built the current PKGBUILD locally but the behavior didn't change, and there is no warning about anything wrong.