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 opened iTerm2 and it changed the prompt to..


I have no idea how this happened, and I can't figure out how to change it. I went to terminal to see if I had the same problem, and it shows the same prompt :/

I did a Google search and it brings up info about Vim, which I have never used, so I'm a little confused. Other people use my computer to help me though, so maybe someone switched something on accident. I'm using a MacBook running 10.8.4.

share|improve this question

migrated from Aug 24 '13 at 21:06

This question came from our site for professional and enthusiast programmers.

That output is controlled by your PS1 variable. It is trying to set the colors for your prompt. However it seems those aren't the right escape codes. Did you change your $TERM variable. (Probably should be xterm or xterm-256color) You should be able to change it in the menus for iterm2 (However I can't tell you which as I'm not sitting front of iterm2 right now) – FDinoff Aug 23 '13 at 21:13
Thanks @FDinoff for leading in me the right direction. This website guided me through the problem, which was a bash profile:… – alex Aug 23 '13 at 21:33

If your prompt is broken, here are the files you should check for any statements containing PS1:

  • ~/.bash_profile
  • ~/.profile
  • /etc/profile

At least on OS X, those are where you'd typically alter your interactive prompt. If only your prompt is broken, and not the entire shell, it should be easy to edit the files in a normal text editor, e.g.

open -e ~/.bash_profile

Remove any offending lines that set PS1, save the configuration file, and restart your shell.

share|improve this answer

They are colour sequences and here is what I have in my .bash_profile


#  Variables PCT and PS1 can be merged into a new PS1 variable:
  PS1="\`if [[ \$EUID -eq 0 ]]; then PCT='\[$LIGHTRED\]';
  else PCT='\[$LIGHTCYAN\]'; fi;
  echo '\[$NC\]['\$PCT'\u\[$YELLOW\]@\[$GREEN\]\h:\w\[$NC\]]\[$GRAY\] : \[$NC\]'\`"
share|improve this answer

Your Answer


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