Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 900859 - app-shells/fzf-0.38.0: include completion scripts for bash and zsh
Summary: app-shells/fzf-0.38.0: include completion scripts for bash and zsh
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-11 09:45 UTC by Stefan
Modified: 2024-01-28 20:37 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
include completion scripts for bash and zsh (fzf-completion.diff,342 bytes, patch)
2023-03-11 09:45 UTC, Stefan
Details | Diff
completion.patch (file_900859.txt,720 bytes, patch)
2023-08-29 06:55 UTC, Sam James
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan 2023-03-11 09:45:53 UTC
Created attachment 857291 [details, diff]
include completion scripts for bash and zsh

fzf has scripts for bash ans zsh to enable fuzzy completion for a specific set of commands. 

The current ebuild does not install these scripts. 

I have attached the diff between the ebuild for 0.38.0 in portage and my local overlay.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-03-13 21:18:04 UTC
Note that we already do:

        newbashcomp shell/completion.bash ${PN}
[...]
        newins shell/completion.zsh _${PN}

Are we not supposed to be doing that?
Comment 2 Stefan 2023-03-13 21:45:06 UTC
(In reply to Sam James from comment #1)
> Are we not supposed to be doing that?

Hmmm. That's a very good question. It seems I completely missed those 2 lines.

I'll have a look tomorrow. I was about ready to go to bed.
Comment 3 Stefan 2023-03-14 20:47:58 UTC
OK. So yes, sourcing the installed _fzf file functions the same as sourcing the additional completion.zsh file installed using my patched ebuild. 

I'm not entirely sure about the following,; I'm pretty new to ZSH. Manually sourcing the file is needed because it is not actually an auto-loading completion script. It's missing the #compdef definition to trigger auto loading 

I had a look at the Arch wiki page for FZF. And it does mention the completion.zsf file, but by its original name. To be honest I'm not really how to proceed from here. 

[0]: https://wiki.archlinux.org/title/fzf
Comment 4 dm9pZCAq 2023-08-26 19:49:11 UTC
completion.zsh should not be installed as _fzf

files in /usr/share/zsh/site-functions that start with an underscore are needed to complete command arguments

but fzf's completion.zsh does not provide fzf command completion, it provides other functionality more like a zsh "plugin"

so i think for zsh it should be installed like Stefan done this in patch
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-08-26 20:07:49 UTC
(In reply to dm9pZCAq from comment #4)
> completion.zsh should not be installed as _fzf
> 
> files in /usr/share/zsh/site-functions that start with an underscore are
> needed to complete command arguments
> 
> but fzf's completion.zsh does not provide fzf command completion, it
> provides other functionality more like a zsh "plugin"
> 
> so i think for zsh it should be installed like Stefan done this in patch

Thanks. Is the current bash setup OK, so we just need to fix zsh?
Comment 6 dm9pZCAq 2023-08-28 11:34:13 UTC
(In reply to Sam James from comment #5)
> Is the current bash setup OK, so we just need to fix zsh?

i think yes, as bash completion provides actual tab completion
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-08-29 06:54:47 UTC
Fedora installs to /usr/share/zsh/site-functions/fzf (no _) which I suppose is what you were saying, I just wasn't sure because of your comment wrt Stefan's patch - but Stefan's patch had kept the _ part in.
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-08-29 06:55:53 UTC
Created attachment 868956 [details, diff]
completion.patch

... so is this right?
Comment 9 dm9pZCAq 2023-08-31 10:30:13 UTC
(In reply to Sam James from comment #7)
> Fedora installs to /usr/share/zsh/site-functions/fzf (no _) which I suppose
> is what you were saying, I just wasn't sure because of your comment wrt
> Stefan's patch - but Stefan's patch had kept the _ part in.
as far as I understand, Stefan's patch installs shell/completion.zsh to /usr/share/fzf/completion.zsh and I think that's ok (there is also an app-misc/skim that does the same thing)

on the other hand, app-shells/zsh-syntax-highlighting installs the "plugin" in /usr/share/zsh/site-functions/${PN}.zsh (note: there is a zsh extension)



(In reply to Sam James from comment #8)
> ... so is this right?
personally, I prefer how this is done in the app-misc/skim
for fzf it would be like this:
/usr/share/fzf/completion.bash
/usr/share/fzf/key-bindings.bash
/usr/share/fzf/completion.zsh
/usr/share/fzf/key-bindings.zsh