After also stumbling upon this problem, I found a solution for it. If you use
color codes in your prompt, you should escape them with \[ and \] to indicate
that they are non-printable characters and bash shouldn't count them while
determining the length of the prompt. This isn't properly documented on a lot of sites which deal with color codes in bash.

If you try this prompt, it should work fine.
export PS1='\[\e[0;31m\]\u\[\e[m\]@\h:\w\$ '

Not sure if this can still be considered a bug in bash.



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to