Remnant characters when tab completing with ohmyzsh

Hi, I have installed ohmyzsh from GitHub on rocky linux 8.5 and when I use the tab key to complete, the first character is repeated.
For example, if I type in:

~ sys

then tab, it turns to

~ ssys
sysctl                          systemd-cgtop                   systemd-resolve               
syserror                        systemd-delta                   systemd-run      

And the first ‘s’ cannot be deleted by backspace.
The ssh software I use is Xshell on Windows.
When I use CentOS 7, this bug does not appear.
I have searched for such issues and configured them.

Here is my .zshrc file.

export TERM=xterm-256color
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
export LANG_ALL="en_US.UTF-8"

/etc/locale.conf file


And I have installed the powerline-fonts

dnf -y install powerline-fonts

Kindly help.

It seems to be a problem with agnoster theme under rocky linux, using robbyrussell theme did not find this bug.

On other themes: cloud was also found to have this problem, while arrow did not.

I found my way to fix it :
Modify the last line of the .oh-my-zsh/themes/agnoster.zsh-theme file

PROMPT='%{%f%b%k%}$(build_prompt) '


PROMPT='%{%f%b%k%}$(build_prompt)%{ %}'

It works. (@^0^@)/
See GitHub #10598