I modified my .bash_profile on my Mac (now running Tiger) to get a different command prompt. Before I did that, I used to be able to use the up arrow key to cycle through previously issued commands. Now, though, I get a weird mix of characters -- it kind of overwrites the prompt with a partial mix of the previous command, making it unreadable. It's very odd and I've clearly done something wrong. The command is actually all there -- if I hit enter, it works, even though I can't clear read it.

export PS1="\[\e[0;36m \w $\[\e[0m\] "
link|improve this question
feedback

migrated from stackoverflow.com Aug 3 '11 at 1:41

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

1 Answer

up vote 3 down vote accepted

you forgot to close the escape sequence for the first color change:

export PS1="\[\e[0;36m\] \w $\[\e[0m\] "
                      ^^
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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