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

Generate zsh completion functions #455

Open
mil-ad opened this issue Nov 6, 2023 · 2 comments
Open

Generate zsh completion functions #455

mil-ad opened this issue Nov 6, 2023 · 2 comments

Comments

@mil-ad
Copy link

mil-ad commented Nov 6, 2023

Is it possible to use argcomplete to generate the actual zsh completion functions for a program? My app startup is quite slow thanks to some imports that take a long time, and that load time finds its way to argcomplete as well. It seems like every time I press tab it's going through my program so it's super slow.

@kislyuk
Copy link
Owner

kislyuk commented Nov 6, 2023

Hello, thanks for your interest in argcomplete.

No, argcomplete does not support the generation of static completions. While possible, this would be a complex set of extra logic and it would lose the key advantage that argcomplete offers and is typically used for (dynamic completion of values).

@maurerle
Copy link

maurerle commented Nov 12, 2023

@mil-ad maybe you have your python startup script inside your module folder.
If you put it outside, and put the app import statements after argcomplete.autocomplete(parser) it works fine and fast (yes do not put the input statement at the top of the file like you normally should do) :)

I had a similar problem with that

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

3 participants