My bash prompt is:

PS1='\e[1;31m\]\[\u\e[0m\]@\h [\e[1;33m\]\w\[\e[0m\]]\$ '

(reddish username, yellowish current directory).

If I connect with Putty from a Windows machine, everything is fine. If I open a terminal window from within the Ubuntu Desktop (a fresh install of 10.04 TLS), the first character of the username and the first character of the path are replaced with Unicode +0002 (a square box showing is drawn in ASCII text below).


The character encoding in the Ubuntu terminal is UTF-8. Putty's translation setting which does the same thing is UTF-8 as well.

Any hints of what is wrong would be appreciated.

Thank you.


It looks like a couple of brackets and backslashes are out of place. Give this a try:

PS1='\[\e[1;31m\][\u\[\e[0m\]@\h \[\e[1;33m\]\w\[\e[0m\]]\$ '

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.