I\'m using oh-my-zsh in Arch linux with the robbyrussell theme loaded. When I try to tab complete I end up with remnant characters appended to the prompt. If I delete the auto-c
As suggested by simont it is likely that the prompt you are using is using unprintable characters (like color escape codes) but does not indicate that those characters are unprintable. So when the prompt is redrawn the terminal believes that the prompt is wider than it actually is.
You indicate that a character sequence in the zsh prompt has zero width using the %{
and %}
delimiters. For example my prompt is:
%{%(?.%F{green}.%F{red})%}➜%{%f%}
The (?...)
is a ternary which sets the color of the prompt and it has been marked up to indicate that it is zero width. In the same way the %f
resets the color and that has also been marked up.
You can test changes to your prompt by updating the PS1 variable, so you can try out different arrangements and see what works for you.
You can mark any characters in this way, so be careful about making your prompt too short!