I can't reproduce this, hitting either Ctrl+E, Ctrl+A or the arrow keys updates the command line correctly. Are you running 10.5.4? Is it perhaps a bug in earlier versions?
views:
1115answers:
10I've encountered this bug, and while I don't know how to solve it, you can work around it by pressing <down><up>
Does iTerm handle this properly? That might help narrow down the source of the problem.
You may want to look at this post.
bash-prompt-in-os-x-terminal-broken
I had the same problem and it had to do with the PS1 variable. Let me know if this helps.
Not sure whether this is the problem here, but a very common cause of a messed up screen in bash (with any terminal emulator, not just Terminal.app) is the window being resized.
Bash will read the window size when it starts up, and then assume it hasn't changed. When the window is resized a signal will be sent to whatever app is currently reading from the console. If this isn't bash (because you're running a text editor at the time, perhaps), then bash won't know about it.
Solution in this case is to resize the window again so that bash gets the signal and notices the new size.
I was able to set my TERM to xterm instead of xterm-color and it solves the problem. (export TERM=xterm).
I'm on 10.5.6 and get the same problem. It happens even when I hit enter instead of ctl-e to exit the reverse search, and even when I use up-arrow to walk commands in reverse. Setting my TERM variable to xterm doesn't help.
In worst case, you could launch the X server (somewhere under utilities) and launch a real xterm.
I have the same issue, when I hit Enter to choose a reverse-i-search command it screw up the output and I have to close the whole application (not just tabs, I need to cmd+q). It's very annoying, anyone found a solution?
Note: with X11 or iTerm the issue disappears, all work as expected! The problem must be somewhere in Terminal application.
I also have this problem, but only if the prompt has colors.
I think this might explain it: http://osdir.com/ml/bug-bash-gnu/2009-07/msg00019.html