zsh-autosuggestions icon indicating copy to clipboard operation
zsh-autosuggestions copied to clipboard

ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE

Open Aur0nd opened this issue 2 years ago • 5 comments

Describe the bug

let's assume that we want to type ls -lha ~/Desktop if I type the whole command then everything works as expected, but if I type "ls -lh" and then accept the suggestion, everything after "ls -lh" is going to have the suggestions color (Greyed out or whatever color I choose).

ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=4'
Screenshot 2023-07-20 at 14 42 58

Desktop

MacOS Sonoma

Aur0nd avatar Jul 20 '23 13:07 Aur0nd

Yup same thing here, if anyone has a workaround that'd be great

Screenshot 2023-07-22 at 10 00 41 AM

Goncharo avatar Jul 22 '23 17:07 Goncharo

Also happens on Arch

hectorhuertas avatar Sep 01 '23 11:09 hectorhuertas

I have this set in my .zshrc:

export ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=8"

This is what happens to me in neovim+tmux: image

This is what happens when using only tmux image

I'm not sure if this issue is related but it's really hard to use the plugin 😢.

Hacksore avatar Sep 02 '23 17:09 Hacksore

setting export ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#f1d687" in my ~/.zshrc worked for me, it is a similar colour to the default.

alifhughes avatar Sep 03 '23 00:09 alifhughes

I had the same problem with

ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#aaa"

image It works with full color hex

ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#aaaaaa"

image

ivanjermakov avatar Feb 02 '24 18:02 ivanjermakov

Problem seems to be that when fg=7 (or anything below 8, at least in my terminal) is added to region_highlight (which is doing the highlighting), it is implicitly replaced by the color name. When undoing the highlighting, this plugin searches for fg=7 exactly to replace it, which then fails.

It's likely more robust to use the memo property for this. EDIT: memo seems to be a ZSH 5.9 feature (the latest version at the time of writing), so not sure whether it makes sense to bump the version requirement to 5.9 for this

patrick96 avatar May 21 '24 12:05 patrick96