Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

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

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?

share|improve this question

migrated from Aug 31 '11 at 21:33

This question came from our site for system and network administrators.

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 '11 at 21:32

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

enter image description here

share|improve this answer
Can you add a little more information? How do you change the color? What commands do you need to run? – daviesgeek Aug 15 '12 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.

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.