zsh-users / zsh-syntax-highlighting

Fish shell like syntax highlighting for Zsh.
github.com/zsh-users/zsh-syntax-highlighting
BSD 3-Clause "New" or "Revised" License
19.5k stars 1.32k forks source link

command highlighted with dark background after completion start #913

Open quicknir opened 1 year ago

quicknir commented 1 year ago

With just the following .zshenv and no other z dot files:

source "/home/nir/config/terminal/prezto/modules/syntax-highlighting/external/zsh-syntax-highlighting.zsh"

ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern root)
ZSH_HIGHLIGHT_STYLES[builtin]='bg=yellow'
ZSH_HIGHLIGHT_STYLES[command]='bg=yellow'
ZSH_HIGHLIGHT_STYLES[function]='bg=yellow'

I see a very strange issue with syntax highlighting. If I type "cd" it syntax highlights correctly, but then after I hit space and tab and begin auto completion, it changes the background of "cd" to a very dark color. Then if I hit backspace, it re-highlights it correctly.

I run a solarized theme, if that matters. Whatever color I set it to above, it highlights it correctly, but then after auto completion starts it always goes to black.

Help appreciated!

I tested this on an ubuntu box with zsh 5.6 and cannot duplicate it; the original problem occurs on WSL, running zsh 5.8.1. The behavior can be reproduced with the default windows terminal emulator, and VsCode's. So I don't think this is a terminal emulator issue.

danielshahaf commented 1 year ago

What are the values of $ZSH_HIGHLIGHT_REVISION and $ZSH_HIGHLIGHT_VERSION?

With just the following .zshenv and no other z dot files:

Are there any global dotfiles (usually named /etc/zsh*)?

after I hit space and tab and begin auto completion, it changes the background of "cd" to a very dark color

After which of the three operations here (hit space, hit tab, "begin auto completion" which may or may not be the same thing as the preceding one) does it turn dark?

If you change bg=yellow to, say, fg=green, does it still turn the same dark color?