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

ZSH completion sourcing doesn't seem to work #1325

Closed
thornycrackers opened this issue Jan 29, 2021 · 1 comment
Closed

ZSH completion sourcing doesn't seem to work #1325

thornycrackers opened this issue Jan 29, 2021 · 1 comment

Comments

@thornycrackers
Copy link

I think this is related to the changes in #1237. I'm trying to get the autocompletion for glab to work. If I try:

source <(glab completion -s zsh)
or
eval "$(glab completion -s zsh)"

I don't get any completion for glab. But if I dump the completion to file on my fpath:

glab completion -s zsh > _glab

Then I get autocompletes. I'm not sure if this is really a bug because the comment says it doesn't want to run the function when it's sourced or evaled but I thought the whole point of the completion command. Feel free to close if this is expected behavior.

@marckhouzam
Copy link
Collaborator

This is the expected behavior. Cobra has chosen not to allow sourcing for zsh completion by default because it is not the recommended way for zsh.

If you really want to be able to source you need to first run the command
compdef _glab glab.

If this satisfies your request could you close the issue, I don't have permissions.

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

No branches or pull requests

2 participants