zsh-autosuggestions is unable to redraw the current line with some modules.
A similar problem and solution is outlined here:
https://github.com/robbyrussell/oh-my-zsh/issues/7945#issuecomment-508724741
I reproduced this by going into a directory with a git repo, enabling zsh-autosuggestions, writing a partial filename, and then using tab filename completion (pressing tab twice by default).
For some reason, it's not the non-ascii symbols mentioned in the link above that's causing it, but the 'style' attributes. By adding style="" to git_branch and git_status, it fixed the problem for me.
Config:
add_newline = false
prompt_order = [
"hostname",
"username",
"directory",
"git_branch",
"git_status",
"package",
"nodejs",
"rust",
"python",
"golang",
"cmd_duration",
"jobs",
"battery",
"character",
]
[character]
symbol = "$"
[cmd_duration]
# 0 second to show time
min_time = 0.1
[username]
disabled = true
[battery]
disabled = true
[package]
disabled = true
[golang]
disabled = true
[ruby]
disabled = true
[nodejs]
disabled = true
[python]
disabled = true
[rust]
disabled = true
[git_branch]
disabled = false
[git_status]
disabled = false
[hostname]
ssh_only = false
prefix = "<"
suffix = ">"
disabled = false
It looks like fish is also affected.
Tab-completion messes up the command line when git status is being displayed.
I can't find it right now, but we have another bug which causes any sort of automatic cursor movement to screw up in bash and zsh. Those are also almost certainly related to the styling--this suggests to me that we have a hidden bug in how the git status module is being displayed right now.
(I can't find the bug right now or I'd link it)
I believe our outstanding bugs with cursor movement are currently fixed. Feel free to re-open or open a new issue if this comes back up!