-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Syntax-highlighting of command will disappear after an unsuccessful completion #919
Comments
It seems like that the default zle widget of This is how Oh My Zsh implements the So anyone who has similar problem can just use the workaround states above, or follow Oh My Zsh to define a zle widget like this: expand-or-complete-then-redisplay() {
zle expand-or-complete
zle redisplay
}
zle -N expand-or-complete-then-redisplay
# Set the function as the default tab completion widget
bindkey "^I" expand-or-complete-with-dots |
I am using the default version of zsh provided by macOS, should I installed another zsh via homebrew and use that? |
As long at you're using at least zsh 5.9, the |
I will try a newer version of zsh later. Thanks for your help. $ echo $SHELL
/bin/zsh
$ $SHELL --version
zsh 5.8.1 (x86_64-apple-darwin21.0) |
Unexpected behavior
After I input something and pressed tab key for completion, if the completion failed, the highlighting of command would disappear.
For example, I have installed this plugin through
antigen
, and installedHomebrew
as well as its zsh completion.First, I typed
brew z
and then I pressed
tab
key for completion.Note that
Homebrew
doesn't have a subcommand started withz
, so the completion will somehow fail.Now the syntax highlighting of command
brew
disappeared.If I try something like
brew i
, then press tab, this time the completion will be successful. A completion list of subcommand started withi
will be displayed, and the syntax-highlighting work as expected.Workaround
I am using
oh-my-zsh
. I found that if I uncomment the following line in the default~/.zshrc
, the problem stated above will be solved.# COMPLETION_WAITING_DOTS="true"
I have investigated the
COMPLETION_WAITING_DOTS
feature ofoh-my-zsh
, but I cannot find anything useful to figure out the cause of unexpected behavior.Environment
Operating System: macOS 12.6.3
Zsh: zsh 5.8.1 (x86_64-apple-darwin21.0)
zsh-users/zsh-syntax-highlighting: b2c910a (commit hash)
Antigen: v2.2.3 (ff391b5)
Homebrew: 4.0.9
The text was updated successfully, but these errors were encountered: