You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After updating to Ubuntu 24.04, I don't get color changes anymore on auto-suggestions. See screenshot.
To Reproduce
Steps to reproduce the behavior:
Sorry haven't found a way to reproduce this. But setting it up from scrats on a new VM it's working like expected. So it's probably something local. :(
Expected behavior
I would expect the coloring to change, to the primary color as before the update.
As a little side note: In a terminal with 24-bit colour support zle can and will accept RGB hash values for colours, but it seems that using such a color for ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE will also break in a similar way and not reset to the "original" colour.
Changing the environment variable to a xterm colour table value makes it work as intended.
My hunch is that the hash character will introduce issues with the region highlight code in other ways, because the changes suggested by #790 do not seem to fix that particular issue.
EDIT: Just confirmed this locally with a simple zsh array that contained string elements that contained a hash symbol. The form ${<array>:#<match>} will not match a string that contains a hash and thus any regions added using RGB hex notation for a colour will not be removed and the region_highlight array will fill up with the same colour regions for different regions.
The solution suggested in #790 is also not viable if other regions are added (e.g. when using this in conjunction with zsh-syntax-highlighting) as the most recent region in the array might have been added by another plugin.
Zsh 5.9 supports adding a memo token that can be used instead (and allows a plugin to "tag" its own regions), but it's not supported by Zsh 5.8 and older and can break on those versions when an unexpected memo token is encountered in the region string.
So for the time being one either has to make sure to only use xterm colour table values (and not use RGB hash colours) or fix this by iterating over all region_highlight elements and explicitly do a string comparison for each and append any non-matching region to a temporary array, before replacing region_highlight with that temporary array.
Activity
Fix colors not being reset on (partial) accept w/ recent ZSH zsh-user…
Fix colors not being reset on accept w/ recent ZSH (fixes zsh-users#789)
Fix colors not being reset on accept w/ recent ZSH (fixes zsh-users#789)
Fix colors not being reset on accept w/ recent ZSH (fixes zsh-users#789)
tomasnorre commentedon Sep 11, 2024
I can confirm that the PR fixes my problem.
PatTheMav commentedon Jun 11, 2025
As a little side note: In a terminal with 24-bit colour support
zlecan and will accept RGB hash values for colours, but it seems that using such a color forZSH_AUTOSUGGEST_HIGHLIGHT_STYLEwill also break in a similar way and not reset to the "original" colour.Changing the environment variable to a xterm colour table value makes it work as intended.
My hunch is that the hash character will introduce issues with the region highlight code in other ways, because the changes suggested by #790 do not seem to fix that particular issue.
EDIT: Just confirmed this locally with a simple
zsharray that contained string elements that contained a hash symbol. The form${<array>:#<match>}will not match a string that contains a hash and thus any regions added using RGB hex notation for a colour will not be removed and theregion_highlightarray will fill up with the same colour regions for different regions.The solution suggested in #790 is also not viable if other regions are added (e.g. when using this in conjunction with
zsh-syntax-highlighting) as the most recent region in the array might have been added by another plugin.Zsh 5.9 supports adding a
memotoken that can be used instead (and allows a plugin to "tag" its own regions), but it's not supported by Zsh 5.8 and older and can break on those versions when an unexpectedmemotoken is encountered in the region string.So for the time being one either has to make sure to only use
xtermcolour table values (and not use RGB hash colours) or fix this by iterating over allregion_highlightelements and explicitly do a string comparison for each and append any non-matching region to a temporary array, before replacingregion_highlightwith that temporary array.Fix region_highlight entries leaking across accept/edit cycles