Fix bash prompt gets overwritten when the text is too long
Daniel Ruiz de AlegrÃa
3 years ago
56 | 56 | fi |
57 | 57 | |
58 | 58 | if [ "$color_prompt" = yes ]; then |
59 | prompt_color=$'\033[01;34m' | |
60 | path_color=$'\033[01;32m' | |
59 | prompt_color='\[\033[1;34m\]' | |
60 | path_color='\[\033[1;32m\]' | |
61 | 61 | if [ "$EUID" -eq 0 ]; then # Change prompt colors for root user |
62 | prompt_color=$'\033[01;31m' | |
63 | path_color=$'\033[01;34m' | |
62 | prompt_color='\[\033[1;31m\]' | |
63 | path_color='\[\033[1;34m\]' | |
64 | 64 | fi |
65 | PS1='${debian_chroot:+($debian_chroot)}${prompt_color}\u@\h\[\033[00m\]:${path_color}\w\[\033[00m\]\$ ' | |
65 | PS1='${debian_chroot:+($debian_chroot)}'$prompt_color'\u@\h\[\033[00m\]:'$path_color'\w\[\033[00m\]\$ ' | |
66 | unset prompt_color path_color | |
66 | 67 | else |
67 | 68 | PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' |
68 | 69 | fi |