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

After writing a new prompt for Bash, I noticed that one character of my commands were being lost when it wrapped to the new line. Here is an image of the example (I typed 1234567890 over and over):


Here is my $PS1

PS1="\n   [\[\e[0;90m\]\d \t\[\e[0m\]] [\[\e[0;90m\]\$(/bin/ls -1 | /usr/bin/wc -l | /bin/sed 's: ::g') files, \$(/usr/bin/du -sh | cut -f1)\[\e[0m]\n[\[\e[0;36m\]\#\[\e[0m]\] \[\e[0;95m\]\u\[\e[0;90m\]@\[\e[1;92m\]\h\[\e[0m\]: \[\e[1;34m\]\w \[\e[1;30m\]\$\[\e[0m\] "

What have I done wrong?

share|improve this question
What's this bit for \[\e[0m]\]? Is the ] supposed to be there? – Mikel Apr 17 '11 at 23:08
up vote 0 down vote accepted

What's this bit for \[\e[0m]\]?

Is the ] after the m supposed to be there?

share|improve this answer
You fixed it! The first ] needed to go at the end (to become \[\e[0m\]]). Thanks! – squircle Apr 18 '11 at 2:48

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.