When it inserts the current choice from the completion menu, the grey autosuggest sticks around and changes to the normal color. See https://asciinema.org/a/ateiyie18acvm3l7srfezt89g for a screencast of the behavior. bindkey '^I' is expand-or-complete.
This is what I was referring to as "minor issues with the buffer displaying incorrectly while inside menu selection" in this comment, but I never created a separate issue for the problem.
Using menu selection is what causes this issue. I believe this is the minimal .zshrc config to reproduce this problem:
autoload compinit && compinit
zstyle ':completion:*' menu select
source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
I haven't yet found a way to bind to a menu selection event to clear/update the suggestion. Probably will need to dig into this document to find a solution.
As far as I know, there are two options to workaround this issue temporarily:
no-select with
zstyle ':completion:*' menu no-select. This will keep suggestions working while doing completions.expand-or-complete in your case) to the list of widgets that clear the suggestion. This will have the effect of disabling suggestions while you're in menu selection, but at least it won't leave a lingering, broken suggestion. Add ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=("expand-or-complete") somewhere in your .zshrc after sourcing this plugin.We may want to add expand-or-complete to ZSH_AUTOSUGGEST_CLEAR_WIDGETS by default, but I believe that would break suggestions for folks not using menu selection, so I think this belongs in individual user configuration for now.
Ah! Thanks for the detailed and quick response, much appreciated.
This should be fixed in v0.3.2 (just released) by commit e87bc74
Most helpful comment
This is what I was referring to as "minor issues with the buffer displaying incorrectly while inside menu selection" in this comment, but I never created a separate issue for the problem.
Using menu selection is what causes this issue. I believe this is the minimal
.zshrcconfig to reproduce this problem:I haven't yet found a way to bind to a menu selection event to clear/update the suggestion. Probably will need to dig into this document to find a solution.
As far as I know, there are two options to workaround this issue temporarily:
no-selectwithzstyle ':completion:*' menu no-select. This will keep suggestions working while doing completions.expand-or-completein your case) to the list of widgets that clear the suggestion. This will have the effect of disabling suggestions while you're in menu selection, but at least it won't leave a lingering, broken suggestion. AddZSH_AUTOSUGGEST_CLEAR_WIDGETS+=("expand-or-complete")somewhere in your.zshrcafter sourcing this plugin.We may want to add
expand-or-completetoZSH_AUTOSUGGEST_CLEAR_WIDGETSby default, but I believe that would break suggestions for folks not using menu selection, so I think this belongs in individual user configuration for now.