The trouble with bash colored prompts munging your control-r bash history searches
Basically, you just want to be very careful properly escaping and ending color sequences in your bash prompt. If you mess them up, when you try to use spiffy bash tricks that mess with your current line, such as control-r to search through your bash history and then left of right arrow to edit that line, you’ll get a partially overwritten line that is impossible to read or edit properly.
1 2 3 4 5 6 7 8 9 10 11 | #Just be careful. Safest to properly end color sequence, so instead of this
#export PS1=”\[\033[01;32m\]\u\[\033[00m\]\[\033[01;31m\]\$(git_br)\[\033[01;32m\]\[\033[00m\]:\[\033[01;36m\]\$(git_pwd)\[\033[00m\]\$ “
#do this
USER_GREEN=’\[\e[01;32m\]’
#NO_COLOR=’\[\e[00m\]’
REPO_RED=’\[\e[01;31m\]’
PATH_BLUE=’\[\e[01;36m\]’
END_COLOR=‘\e[m’
PS1=”${USER_GREEN}\u${END_COLOR}${REPO_RED}\$(git_br)${END_COLOR}:${PATH_BLUE}\$(git_pwd)${END_COLOR}$ “
|