-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Another approach for zsh completion #1218
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you pull in the default branch to fix the failing test please 🙏🏼
@z0rc Can you pull in the default branch to fix the failing test please 🙏🏼 |
Completion file shouldn't be sourced. It should provide only completion code (source of _command) for command. It's task for package manager or user to put under $fpath.
@lynncyrin done. This is work in progress, still requires consensus about proposal and documentation updates if proposal accepted. Marked as draft and awaiting your input. |
There is no need to define custom shell var, when Zsh can be detected by checking SHELL env var.
Also refactored how zsh shell is detected. |
This issue or PR has been automatically marked as stale because it has not had recent activity. Please add a comment bumping this if you're still interested in it's resolution! Thanks for your help, please let us know if you need anything else. |
Closing this as it has become stale. |
Another approach for zsh completion (#1218)
What type of PR is this?
What this PR does / why we need it:
I want to open discussion how this project provides completion for zsh. Current situation isn't right and promotes cargo-cult approach to enable zsh completions.
Completion file shouldn't be sourced. It should provide only completion code (source of
_command
function) forcommand
. Ideally this file should be just template/example, where developer should replace$PROG
with name of binary and distribute it with_command
name somewhere under project's contrib folder (alongside with man pages, vim syntax etc). As go build system isn't able to properly install this kind of stuff, it's up to package manager (homebrew, dpkg etc) to pick up this_command
file and put it under correct$fpath
where zsh can autoload it.Currently this PR changes only zsh completion example. The documentation needs to be updated too. I can look into if there is agreement with current proposal.
Special notes for your reviewer:
There is fundamental problem with this project calling "completions" as "auto-completions", which are different terms. See https://www.gnu.org/software/bash/manual/html_node/Programmable-Completion.html and http://zsh.sourceforge.net/Doc/Release/Completion-System.html for correct terminology. You might want to fix this in future.