-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 completions doesn't display list of available commands when pressing tab #1565
Comments
Hi, thanks for reporting. It looks like your zsh shell has lots of customizations. Could it be that one of these customizations is affecting the behavior of typing Here is what I get when I press Tab:
My autoload -U compinit
compinit -i
autoload colors
colors |
It does have lots of customization, mainly because of zsh4humans (sort of a zsh framework). I've never experienced issues with completions, until now. My guess is that rbenv use the old completion system for zsh, compctl and until now I have used - rather the programs I use, handle completions with - the 'new' system (completions are managed by underscore files, like _rbenv and are in the fpath). Also, in my zsh I don't declare autoload -U compinit anywhere, this is manged my zsh4humans as far as I know. I guess this is mainly a problem with my zsh config (zsh4humans). So I will reach with them ans see if I can fix this. Thanks.
I tried this with no avail. |
Correction, zsh4humans does have the autoload line, in particular this one: With the help of this, and editing the completion file @@ -2,11 +2,11 @@ if [[ ! -o interactive ]]; then
return
fi
-compctl -K _rbenv rbenv
+compdef _rbenv rbenv
_rbenv() {
- local words completions
- read -cA words
+ local completions
emulate -L zsh
@@ -16,5 +16,5 @@ _rbenv() {
completions="$(rbenv completions ${words[2,-2]})"
fi
- reply=("${(ps:\n:)completions}")
+ compadd - "${(ps:\n:)completions}"
}
I got it working I don't know if this will broke someone else completions, but maybe you can test it and if everything works it could be a potential fix for other people with this problem. |
It's true that we still use the outdated However, the point that I was making is that even with the |
Could you run |
You're right, I tried this as well and it didn't work for me for some reason
It is listed, it's the first one to appear. |
Well, that is really weird. You're welcome to submit a PR with your changes that transition to compsys! I was hoping to explore improving zsh completions anyway by adding descriptions to completed commands. |
Thanks for taking your time to reply btw! I will submit a PR with those little changes mentioned above that transition to compsys. However it doesn't have descriptions. I'm actually working in that version (with descriptions), when I finish it (or at least most of it) I will submit another PR. |
Thanks a lot! I also had a code spike locally for adding descriptions, so I have added it to your PR. Please take a look before you spend time implementing the same! Of course, simpler approaches than mine are aways welcome. |
Fixed in #1569 |
Expected behaviour
Pressing
<TAB>
should display a list of commandsExample with
gem
:When typing a command and there's only one possible option, it should complete the whole command
Example with
gem
:Actual behaviour
Pressing
<TAB>
DOES NOT display a list of commandsExample:
When typing a command and there's only one possible option, it DOES complete the whole command
Example:
Some extra info
The only thing related to rbenv in my
.zshrc
is this:The text was updated successfully, but these errors were encountered: