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

I like to use a custom prompt (current path in blue) on my unix machine:

export PS1='\[\e[0;34m\]\w \$\[\e[m\] '

But when I try to use it on Mac's terminal it doesn't work: it fails to detect the end of the prompt and overwrites the prompt when I type commands. This also happens when I'm inputting a long command where it wraps over the same line instead of starting a new line.

I don't understand why this is the case since I use bash on both machines. Any suggestions on how to remedy this?

share|improve this question
Please check the output of echo $PS1 to ensure the actual value being used for PS1. The line in question is correct and should work on you Mac. – chepner Sep 9 '12 at 15:37

It seems to work for me in both Terminal and iTerm2. Maybe I am misunderstanding what you are asking?

screenshot of prompt being applied with long command and line wrapping

share|improve this answer

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.