Before I installed Lion opening a terminal window placed the cursor at the end of the prompt like so:

Wed Aug 31{shirsch4@Susan-Hirschs-iMac}/projects/perl/perl/lib/Utils--><cursor>

Now when I open a terminal window I get the cursor somewhere in the middle of the prompt like so:

Wed Aug 31{shirsch4@Susan-Hirsch<cursor>-iMac}/projects/perl/perl/lib/Utils-->

How can I correct this?

  • 1
    try reset ; stty sane ; clear at the command prompt. If that doesn't solve it wait until this gets migrated over to the Apple site, where some OS X gurus should be able to suss out what's wrong, because I can't think of anything that would cause the behavior you describe short of your terminal settings getting b0rked...
    – voretaq7
    Aug 31, 2011 at 21:32

2 Answers 2


In Terminal > Preferences, change xterm-256color to xterm-color:

enter image description here

  • 2
    Can you add a little more information? How do you change the color? What commands do you need to run?
    – daviesgeek
    Aug 15, 2012 at 2:17

The problem is that the curses package that is in charge of drawing your screen is miscounting the number of characters because your prompt contains some colour escape sequences.

To see this you can go echo $PS1 at the command prompt and see that it contains something like \[\033[34m\] at either end. This is the colour escape sequence.

The answer is to tell curses the correct terminal type so that it counts properly. Do that in Terminal > Preferences > Advanced - mine is set to xterm256color but any of the xterm choices should work. Note that this setting will only apply to Terminal windows created after you change the setting not any you have open when you make the change.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .