I want my prompt to display:
current (absolute) working directory, colored in green and
in a NEW line, the dollar sign and an empty space.
I am using this line in .profile
export PS1='\e[0;32m$(pwd)\n\e[m$ '
So when in e.g. Desktop
, my prompt looks like this:
However, sometimes when hitting the up arrow to re-run previous commands, at the start of the prompt a random char sequence appear that does not seem to go away unless I hit enter, e. g.
I have never hit a cd cd Desktop
command. The weirdest part is that backspace won't even delete the first one of the two cd
commands above!
Any suggestions?