Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
FS#49951 - [fzf] Fuzzy completion script installed to incorrect location
Attached to Project:
Community Packages
Opened by Hermann Zahnweh (eigengrau) - Tuesday, 05 July 2016, 06:48 GMT
Last edited by Pierre Neidhardt (Ambrevar) - Monday, 11 July 2016, 08:27 GMT
Opened by Hermann Zahnweh (eigengrau) - Tuesday, 05 July 2016, 06:48 GMT
Last edited by Pierre Neidhardt (Ambrevar) - Monday, 11 July 2016, 08:27 GMT
|
DetailsDescription:
fzf ships a file named completion.zsh. Our package installs this file into the Zsh completion directory. However, the file does *not* define any compdefs at all. Rather, it includes a script with one keybinding, which must be sourced manually. As such, completion.zsh should also be installed under /usr/share/fzf. Note that, afaict, this is not true of completion.bash, which actually seems to use the Bash builtin completion system. Additional info: * fzf 0.13.2-1 |
This task depends upon
I wonder why you have to source it manually. Can you confirm?
It looks like fzf is not using the conventional completion system but binding on TAB instead, for whatever reason.
I don't know if this is considered bad practice for Zsh.
> Well, the completion file works for me: Zsh should parse anything in this folder, whether it has a compdef or not.
Can you confirm that the file really works for you? Zsh doesn’t automatically *source* stuff from that directory. It’s just meant for autoloaded *functions*, which are either declared via the autoload builtin, or by adding an autoload tag to the first line of the file. In any case, fzf’s completion.zsh does not contain an autoloaded function. You can confirm this via `which fzf-completion`. The way fzf is currently packaged, you should get `fzf-completion not found`.
completion.zsh is a bad choice for the filename, so it’s an easy mistake to make. What completion.zsh does is define a ZLE widget (*not* a completion command) and binds the widget to the TAB key. The widget will be triggered when you end a command line with `**<TAB>`. You can see that the currently packaged version doesn’t enable this by doing `ls /tmp/**<TAB>`. If you just get the expanded filenames, then it’s not working. completion.zsh will instead open fzf. Same thing for `ssh **`, where it should show an fzf dialog listing all your SSH hosts.
completion.zsh is meant to be sourced from the user’s config, in the same way keybindings.zsh is meant to be sourced. It’s just an additional widget and a keybinding, not a command completion for the fzf command.
Best regards,
I don't like tangling configuration together and I'd prefer to separate keybindings from completion, which would also follow your recommendation.
Does anybody see a reason to keep the patch?