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).

 __
|00|
|02|
 __

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.

link|improve this question
feedback

1 Answer

up vote 0 down vote accepted

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\]]\$ '
link|improve this answer
excellent, thanks! – user43348 Jul 20 '10 at 11:36
feedback

Your Answer

 
or
required, but never shown

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