Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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