If I write some command line and I forget to put something in the middle, I normally go back and start typing there
% command --option -s █ --something-else
^ cursor
Then I might want to use the autocomplete feature, so I press TAB. In my configuration (which I'll post below) two things can happen:
(type "lon")
% command --option -s lon█ --something-else
(press TAB)
% command --option -s long_folder/█ --something-else
% command --option -s lon█ --something-else
(press TAB)
interactive: lon[]
long_folder/ loong_folder/ whatever/
(press arrow down)
% command --option -s long_folder/█hing-else
As you can see pressing TAB overwrites part of what was next. How to avoid this?
Relevant part of my .zshrc
autoload -Uz compinit
compinit
setopt noautomenu
setopt globcomplete
bindkey '^i' complete-word
setopt nolisttypes
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*' menu yes select interactive
The last line is responsible for this behavior.
I can confirm that that’s a bug in zsh
. I’ve submitted a bug report on the Z Shell mailing list about it.