# Remnant characters when tab completing with ohmyzsh

**URL:** <https://forums.rockylinux.org/t/remnant-characters-when-tab-completing-with-ohmyzsh/5153>\
**Category:** Social & Community\
**Created:** [January 19, 2022, 3:16am UTC](https://forums.rockylinux.org/t/remnant-characters-when-tab-completing-with-ohmyzsh/5153 "2022-01-19T03:16:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Charles](https://avatars.discourse-cdn.com/v4/letter/c/6f9a4e/32.png) [@Charles](https://forums.rockylinux.org/u/Charles)\
**Post date:** [January 19, 2022, 3:16am UTC](https://forums.rockylinux.org/t/remnant-characters-when-tab-completing-with-ohmyzsh/5153/1 "2022-01-19T03:16:13Z")

</div>

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:

```auto
~ sys

```

then tab, it turns to

```auto
~ 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.

> <https://stackoverflow.com/questions/19305291/remnant-characters-when-tab-completing-with-zsh>

Here is my .zshrc file.

```auto
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"
...
plugins=(
    git
    zsh-autosuggestions
    zsh-syntax-highlighting
)

```

/etc/locale.conf file

```auto
LANG="en_US.UTF-8"

```

And I have installed the powerline-fonts

```auto
dnf -y install powerline-fonts

```

Kindly help.

---

<div class="post-metadata">

**Author:** ![Charles](https://avatars.discourse-cdn.com/v4/letter/c/6f9a4e/32.png) [@Charles](https://forums.rockylinux.org/u/Charles)\
**Post date:** [January 19, 2022, 5:49am UTC](https://forums.rockylinux.org/t/remnant-characters-when-tab-completing-with-ohmyzsh/5153/2 "2022-01-19T05:49:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Charles](https://avatars.discourse-cdn.com/v4/letter/c/6f9a4e/32.png) [@Charles](https://forums.rockylinux.org/u/Charles)\
**Post date:** [January 19, 2022, 7:54am UTC](https://forums.rockylinux.org/t/remnant-characters-when-tab-completing-with-ohmyzsh/5153/3 "2022-01-19T07:54:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Charles](https://avatars.discourse-cdn.com/v4/letter/c/6f9a4e/32.png) [@Charles](https://forums.rockylinux.org/u/Charles)\
**Post date:** [January 20, 2022, 6:13am UTC](https://forums.rockylinux.org/t/remnant-characters-when-tab-completing-with-ohmyzsh/5153/4 "2022-01-20T06:13:23Z")

</div>

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

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

```

to

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

```

It works. (@^0^@)/  
See GitHub [#10598](https://github.com/ohmyzsh/ohmyzsh/issues/10598#issuecomment-1017151431)

---

<div class="post-metadata">

**Author:** ![brian](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/brian/32/5777_2.png) [@brian](https://forums.rockylinux.org/u/brian)\
**Post date:** [August 25, 2023, 3:56am UTC](https://forums.rockylinux.org/t/remnant-characters-when-tab-completing-with-ohmyzsh/5153/5 "2023-08-25T03:56:57Z")

</div>

Closed on August 25, 2023, 3:56am UTC


