When I ssh into a Linux server from bash Terminal, I can use CTRL+A to return to the start of line properly, and CTRL+E to go to end of line and everything works fine.
When I use bash locally on my Mac, when I use CTRL+A it logically goes back to the start of the line, but doesn't display the cursor in the correct place. It displays the cursor 7 or so characters off and doesn't update the line text correct.
Example
find . -name "hello.cpp"
CTRL+A!
find . -name "hello.cpp"
^~~ cursor shows here ????
Insert "this is a test" (just to show)
Displays:
find . this is a test -name "hello.cpp"
^~~ cursor is still here ???
^~~~~~~~~~~~~^ text inserted here ???
^~~~~~^ unchanged for some reason
Command executed
this is a test find . -name "hello.cpp"
I use the same
PS1=\n \e[1;95m \u@\h \e[0;32m\w \e[1;30m $(__git_ps1 " (%s)" ) \n \e[1;95m \@ \n $ \e[0;30m
as I do on Linux.
Version Info
- bash version: 3.2.57(1)
- terminal version: 2.6.1 (361.1)
- OS X El Capitan, 10.11.5
\[
and\]
around the colors solved the problem. It's actually the inverse of the other problem, which I'd recommend changing the subject line for as this is a more general issue than just for "emacs style". Do you want me to mark as duplicate even though they're inversed? I think this subject would make it easier to find.