You are not logged in.
Ok, This is driving me crazy at the moment.
The home and end keys are being recognised, and jump to the right location in the string, but the visual display is messed up. When I press <home> after a long line, the cursor now jumps to the middle of the command. Similarly with <end>. The actual cursor seems to get out of sync with the visual cursor, and it is driving me crazy!
For example: cursor shown as []
>a-very-long --command --with --args[]
#Press <home>
>a-very-long --[c]ommand --with --args
#Press <end>
>a-very-long --command --with --args []
Similarly, using <up> to move through your history garbles your line:
>once-again --some --long --command
...output...
>cat foo.txt
...output...
#Press <up> twice to get to previous command:
>once-again --scat foo.txt
Does anyone know what is causing this? Is there a way to fix it?
Last edited by d_d (2010-05-19 12:54:33)
Offline
This sounds like a bad PS1. If you use color escape sequences in your prompt, you'll have to enclose them in \[ and \] so that bash can calculate the proper prompt length. In fact this applies to all non-printable characters in your prompt.
For example, my PS1 looks like this:
PS1="\[\033[0;36m\]\w\$> \[\033[0m\]"
Your second problem is probably due to the same issue.
Last edited by hbekel (2010-05-19 12:51:03)
Offline
Thanks hbekel! That was it.
Offline