I started to manage a new server based on CentOS. I wanted to change the prompt, so I wrote the following command :
PS1="\e[0;36m[`pwd`]\$\e[m "
It worked perfectly. But since I got an annoying issue. When I write something quite long, or displays an older command that is quite long using up arrow, or paste it, and then click on "home" to get to the top of the line, the cursor stops within the command, 10 characters ahead of the prompt. For example, lets say I write this :
[/]$ git log --pretty=oneline
And then click on home button, the cursor will stop on the "p" letter, after "--". And if I try to move with left key to get on top of the line, it does that annoying bip saying "you are already there, mate"...
Now, lets say I wrote
ls
and right after
git log --pretty=oneline
If I go up two times, the prompt displays this :
[/]$ git log --ls
And if I keep going up the "git log --" never goes away. Now if I press enter, it will still launch the ls command without any problem. Seems like it's just a display issue. But still, that confuse me all the time...
Thanks ahead for your help !