Escape colores in bash prompt

Unescaping colors in bash prompt causes problems with scrolling
history in bash prompt. you can see leftovers from previous
commands when going back by history.
All colors in command prompt should be escaped with \[ \]
This commit is contained in:
Sagi Shnaidman 2018-11-17 13:02:34 +02:00
commit d3ccdc4cc0

View file

@ -54,7 +54,7 @@ if [ -n "$TMUX" ] || [ "${TERMCAP#*screen}" != "${TERMCAP}" ]; then
;;
*)
# Use Googley colors (blue / red / yellow / blue / green / red )
PS1="${debian_chroot:+($debian_chroot)}\[\e[31m\]\$(byobu_prompt_status)\[\e[38;5;69m\]\u\[\e[38;5;214m\]@\[\e[38;5;167m\]\h\[\e[38;5;214m\]:\[\e[38;5;71m\]\w\[\e[38;5;214m\]\$(byobu_prompt_symbol)\e[00m\] "
PS1="${debian_chroot:+($debian_chroot)}\[\e[31m\]\$(byobu_prompt_status)\[\e[38;5;69m\]\u\[\e[38;5;214m\]@\[\e[38;5;167m\]\h\[\e[38;5;214m\]:\[\e[38;5;71m\]\w\[\e[38;5;214m\]\$(byobu_prompt_symbol)\[\e[00m\] "
;;
esac
fi