fd icon indicating copy to clipboard operation
fd copied to clipboard

[Docs] `README.md` completion instructions are outdated and incorrect for fish

Open PeithonKing opened this issue 2 months ago • 3 comments

The README.md#completions section for fish shell instructs users to:

fish: Put fd.fish in ~/.config/fish/completions

I could not find the fd.fish file anywhere in the repository.

I was later informed (LLM) that the correct method is to generate the file using the binary itself, like this:

fd --gen-completions=fish

# and maybe this actually
fd --gen-completions=fish > ~/.config/fish/completions/fd.fish

I tried this command, and it successfully generated a working completion file.

Could the README.md be updated to reflect this correct, modern method?

I would be happy to open a PR for this with a go ahead from you.

PeithonKing avatar Oct 27 '25 04:10 PeithonKing

I could not find the fd.fish file anywhere in the repository.

It isn't in the repository, but it is in the built packages on the releases page. For example, in https://github.com/sharkdp/fd/releases/download/v10.3.0/fd-v10.3.0-x86_64-unknown-linux-gnu.tar.gz

tmccombs avatar Oct 27 '25 04:10 tmccombs

so I have two questions:

  • should it not have been in the repository? like I don't know the conventions regarding this... but more importantly...
  • should the official version to get the file not be fd --gen-completions=fish > ~/.config/fish/completions/fd.fish irrespective of where that file is? these are genuine questions, tone is definitely not rhetorical

BTW I had installed using sudo apt install fd-find

PeithonKing avatar Oct 27 '25 06:10 PeithonKing

should it not have been in the repository?

No. The repository is for the aourcecode, but thy completion script is generated

should the official version to get the file not be fd --gen-completions=fish > ~/.config/fish/completions/fd.fish irrespective of where that file is

It kind of depends on how you install fd. IIRC, the version of fd in the tarball is compiled without the --gen-completions option, but the completions are included in the tarball.

BTW I had installed using sudo apt install fd-find

Then you should already have completions in /usr/share/fish/completions

tmccombs avatar Oct 27 '25 17:10 tmccombs