-
Notifications
You must be signed in to change notification settings - Fork 425
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
In ZSH, use of compinit clobbers existing completions #1526
Comments
Thank you for raising this! |
I haven't tried editing the autocomplete scripts directly yet, but bash seems fine with it if I put it in a I'll see if I can find some time to make a PR; should be a quick change. |
That would be great, thank you! Most of my time is occupied with Log4j recently... |
@bherw Have you had a chance to look at this? |
I have a patch that should work in theory but unfortunately I don't have access to the programs I was working on before at this point so I'll need to rebuild something similar to test. |
I'm generating completions for a bunch of commands in a row and trying to load all their completions sequentially like so:
This works great in bash, but unfortunately in zsh the "compinit" call at the top of each script resets all the rest of the completions, resulting in only the last command alphabetically in the directory getting any completions.
I've worked around this for now by adding an
alias compinit=
before the loop.Based on https://zsh.sourceforge.io/Doc/Release/Completion-System.html, compinit defines compdef, so I think testing if it's already loaded as follows should be enough to avoid clobbering completions:
The text was updated successfully, but these errors were encountered: