ohmyzsh
ohmyzsh copied to clipboard
zsh-autosuggestions colours no longer differentiated
Describe the bug
For the last few weeks, I've noticed that the colour used for zsh-autosuggestions
is no longer different to the main text colour typed at the prompt. My .zshrc
is relatively boring; I'm using default robbyrussell
theme with no modifications. I was used to seeing the zsh-autosuggestions
text in a greyed out colour, which made it easier to differentiate when typing at the prompt.
The only (slightly) unusual thing about my setup is that I use powerline, but disabling powerline in my .zshrc
doesn't change the behaviour I'm seeing.
Steps to reproduce
Start typing at the command prompt; auto suggested text comes up to the right of the prompt, but in the same colour as the text I've typed.
I've tried adding export ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=60'
to the end of my .zshrc
, but no value of fg
makes any difference to the colour of the suggested text.
Expected behavior
Previously, the auto-suggested text came up in a greyed out colour.
Screenshots and recordings
Here's how it looks currently:
I'd expect the sion
text to come up in a greyed out colour to differentiate it from the text I've already typed (omz ver
)
OS / Linux distribution
macOS 12.4
Zsh version
5.8.1
Oh My Zsh version
master (e9e8c6b5)
Terminal emulator
Terminal.app
If using WSL on Windows, which version of WSL
No response
Additional context
My .zshrc
content:
export ZSH="/Users/nick/.oh-my-zsh"
ZSH_THEME="robbyrussell"
plugins=(zsh-syntax-highlighting zsh-autosuggestions git docker k)
source $ZSH/oh-my-zsh.sh
unsetopt beep
export PATH=/Users/nick/Library/Python/3.8/bin:$PATH
/Users/nick/Library/Python/3.8/bin/powerline-daemon -q
. /Users/nick/Library/Python/3.8/lib/python/site-packages/powerline/bindings/zsh/powerline.zsh
export PAGER=/usr/local/bin/vimpager
alias less=$PAGER
alias zless=$PAGER
export LSCOLORS=ExGxcxdxCxegedabagacad
alias k="k -ah"
Have you checked whether disabling OMZ and sourcing the zsh-autosuggestions
plugin manually gets you the same issue? Have you tried also disabling the zsh-syntax-highlighting
plugin?
Thanks @mcornella for the suggestions. I can confirm that both methods restore the expected behaviour. That is:
- If I disable OMZ and source
zsh-autosuggestions
, the suggestion is correctly formatted in a greyed out colour - If I enable OMZ and disable
zsh-syntax-highlighting
, the suggestion is correctly formatted in a greyed out colour
And if I put it back (OMZ enables, zsh-syntax-highlighting
), I continue to lose the greyed out colour for suggestions.
I hope that helps - is there anything further I can do?
I had the same issue a few weeks ago, as a workaround I simply disabled zsh-syntax-highlighting
plugin.
Hi @BafS - I can see that would be a workaround, but it would be nice to fix it.
One comment I can add: at the moment, the issue is only impact macOS. My Linux (Debian Bullseye) are behaving as expected (rendered on a macOS terminal).
No worries, I finally find out the magic.
Based on @BafS clues, I simply upgraded zsh-syntax-highlighting
to latest version and zsh-autosuggestions colors are back with zsh-syntax-highlighting
working as expected.
BTW, this issue happened after I upgraded my MacOS to 12.4.
Thanks for reporting the solution.