blank
January 17, 2026, 12:55pm
1
Relevant home-manger config stuff:
{
programs.zsh = {
enable = true;
autosuggestion.enable = true;
autosuggestion.highlight = let palette = config.colors.palette; in "fg=#${palette.base0E},bg=#${palette.base01}";
};
}
Example of the behavior, only typed sudo and pressed accept. Note that the highlight was partly cleared.
Expected behavior:
Similar issues:
opened 04:45PM - 21 Jul 22 UTC
bug
### Describe the bug
If `ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE` is manually set where… fg or bg are less than 8, then the highlighting is not reset when accepting or partially accepting the suggestion.
### To Reproduce
```sh
% zsh -df
% source path/to/zsh-autosuggestions.zsh
% ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=1'
% ZSH<right arrow key>
```
(instead of typing `<right arrow key>` press the right arrow key on your keyboard to accept the autosuggestion, which should be `_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=1'` in red text).
At this point, `ZSH` should be in the regular color but `_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=1'` (which was completed) will still be in red.
Note that similar results occur for `fg=x` or `bg=x` when x<8, or a combination thereof (`fg=x,bg=y` where **either** x or y are <8).
### Expected behavior
The color of `_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=1'` would be reset, like when the variable is unchanged or set to a value >=8.
### Screenshots

Note how the cursor (yellow vertical bar) is ahead of the red text, so it has retained the color even though it was accepted.
### Desktop
- OS + distribution: Arch Linux
- Zsh version: 5.9
- Plugin version: a411ef3e0992d4839f0732ebeb9823024afaaaa8
- Terminal: alacritty 0.11.0-dev (ed4614d0)
### Additional context
If I remember correctly, this issue began when I updated to zsh 5.9. I'm not exactly sure whether it was that update, but I know I didn't use to have this issue and started having it sort of recently (a few weeks or months ago).
However in this case, it doesn’t work with any styling; with just bold, underline, color or all combined.
Does somebody happen to have a work around? Thanks.
blank
January 20, 2026, 2:49pm
2
This fixes it:
{ autosuggestion.highlight = "fg=magenta"; }
For non home-manager users this is just:
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=magenta"
Only color names work even “fg=1” doesn’t work.
In the documentation: zsh: 18 Zsh Line Editor
They say that highlight support depends on the terminal so this issue might be caused by a bug in ghostty or it’s just (zsh or in the plugin) issue don’t know don’t care.
blank
January 20, 2026, 5:45pm
3
Reading more on the topic I’m pretty sure the issue is on zsh side.