Super User is a question and answer site for computer enthusiasts and power users. 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

So often, I run a command in either or iTerm, press the up arrow to go back to edit it, and the cursor jumps to the line above or somewhere totally in the wrong place. It especially happens when the command is so long that it wraps around to the next line. Sometimes these long commands all appear on one line, and sometimes they display correctly on multiple lines.

This happens in both iTerm and

Also happens in both vi and emacs modes, making them pretty much unusable.

any ideas? thanks!

share|improve this question
up vote 18 down vote accepted

It is most likely because your prompt definition includes sequences that should not be counted in the length of the prompt, such as those for setting colors. These sequences should be between \[ and \] to prevent their length from being counted. Here is an example that produces an all-red prompt:

share|improve this answer
that was it, thanks! – carillonator Nov 5 '10 at 14:22
This line is in the config file (like .bashrc or .bash_profile), for anyone - like me - who is clueless after reading the response. – montrealist Jul 8 at 16:03

For anyone who having this issue, this bug is fixed. For more info you can visit here.

You might have to pull the latest source from github and build from source.

share|improve this answer

You must log in to answer this question.

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