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

You cannot eval completion scripts for multiple binaries. #203

Open
lkarbownik opened this issue Aug 9, 2017 · 1 comment
Open

You cannot eval completion scripts for multiple binaries. #203

lkarbownik opened this issue Aug 9, 2017 · 1 comment

Comments

@lkarbownik
Copy link

lkarbownik commented Aug 9, 2017

When you try to eval two different completion scripts for two different binaries only the last one is working correctly.

e.g.
Evalutuating the folowing code will result in completion working properly only for the binary2

eval "$(binary1 --completion-script-zsh)"
eval "$(binary2 --completion-script-zsh)"

The issue seems to be caused by running compinit again, which resets completion module and removes previously added autocompletion scripts.

I propose to remove calls to compinit and bashcompinit and leave this responsibility to the user.

@lkarbownik
Copy link
Author

Temporary solution for those of you who encountered this problem.
You can use the following snippet to evaluate multiple completion scripts correctly in .zshrc:

eval "$(binary1 --completion-script-zsh | sed '/^#/d;  /^autoload/d')"
eval "$(binary2 --completion-script-zsh | sed '/^#/d;  /^autoload/d')"

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

1 participant