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
Only run compctl if it's an interactive shell #163
Only run compctl if it's an interactive shell #163
Conversation
Perhaps this belongs in rbenv-init instead? |
I shouldn't think so.. it is sourced internally by zsh. Edit: I misrepresented myself. rbenv is responsible for this being sourced, but it's not $SHELL agnostic, and the entirety of the code for zsh completion is contained here. It makes little sense to attempt to move any of it to the core. |
Then perhaps the entire file should be within the if block. EDIT: Actually, this brings up a good point. I think it would be nice to be able to perform login-only setup separately from interactive-only. For example, when I log in to Gnome, I want rbenv added to my $PATH. When I start a shell, I want the functions and completion. Using 'rbenv init' for the latter duplicates the entries in $PATH. |
Valid point. I am in two minds, it isn't inconcievable that a non interactive process would want to interact with the completion function in some way (automatic and introspective documentation systems perhaps?) I lean towards agreeing though. |
Oh, and relating to your second point, some abuse of I will add it to my todo list to create a second init step, or adjust the existing one to test for it's shims in PATH before adding them. |
Based on the approach by @imajes
Force pushes don't actually make pull requests as angry as I thought they might. Huzzah! |
Well Zsh has typeset -U for unique arrays like $path. |
I opened an issue for it #164 to avoid clogging this one with unrelated noise when it gets looked over by upstream. Cheers |
…active_shells Only run compctl if it's an interactive shell
…interactive_shells Only run compctl if it's an interactive shell
Based on the approach by @imajes