Skip to content
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

Better integration with zsh #189

Closed
dtcyganok opened this issue Dec 5, 2017 · 7 comments · Fixed by #654
Closed

Better integration with zsh #189

dtcyganok opened this issue Dec 5, 2017 · 7 comments · Fixed by #654

Comments

@dtcyganok
Copy link

Currently autocomplete by Tab for [<path>] argument does not works.

@dtcyganok dtcyganok changed the title Better integration with zhs Better integration with zsh Dec 5, 2017
@sharkdp
Copy link
Owner

sharkdp commented Dec 14, 2017

Thank you for reporting this. Currently, autocompletion files are auto-generated. I'm not sure if this can be fixed by configuring clap. Any help would definitely be appreciated.

@sharkdp
Copy link
Owner

sharkdp commented Jan 1, 2018

It looks like this is related to clap-rs/clap#568

@thernstig
Copy link

thernstig commented Apr 20, 2020

@sharkdp I just installed fd via sudo dpkg -i fd_8.0.0_amd64.deb but got no auto-completion items for the fish shell. Is this issue the same as this one, or a new issue?

edit: I've re-tested and auto-completion does work, so nevermind this.

@sharkdp
Copy link
Owner

sharkdp commented Apr 20, 2020

That's something else. Could you please open a new ticket?

@smancill
Copy link
Contributor

smancill commented Sep 22, 2020

I have written a native Zsh completion script for personal use (actually, I had no idea there was an autogenerated completion script), and I have been thinking of sharing it with zsh-users/zsh-completions or here, and I found this issue. I took existing _find completion as example, so the completion offers the letters for -t, or commands and options for -x, and directories for the second positional argument, for example.

Here it is working:

asciicast

I can create a PR if you are interested. I have fd 7.5.0 installed though, I would need to check if there are missing options for newer versions, but shouldn't be a problem.

@sharkdp
Copy link
Owner

sharkdp commented Sep 22, 2020

so the completion offers the letters for -t, or commands and options for -x, and directories for the second positional argument, for example.

That sounds fantastic!

I can create a PR if you are interested. I have fd 7.5.0 installed though, I would need to check if there are missing options for newer versions, but shouldn't be a problem.

I'd be glad to replace the auto-generated file with the hand-written, if it's up to date. I guess a few changes will be necessary to the build/deployment system as well. See for example:

install -Dm644 target/$TARGET/release/build/$PROJECT_NAME-*/out/_$PROJECT_NAME "$tempdir/usr/share/zsh/vendor-completions/_$PROJECT_NAME"

@sharkdp
Copy link
Owner

sharkdp commented Dec 6, 2020

released in v8.2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants