Zsh autosuggestion highlight isn't cleared on confirm

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:

image

Similar issues:

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.

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.

Reading more on the topic I’m pretty sure the issue is on zsh side.