comparison .bash_prompt @ 261:7651a91983cd

Had to swap the logic on PROMPT_COMMAND, and one more escape slash.
author Steve Huston <huston@srhuston.net>
date Sat, 30 Mar 2024 17:36:58 -0400
parents 09e37b590785
children 93279b4ed0b4
comparison
equal deleted inserted replaced
260:15543c169f36 261:7651a91983cd
132 # previous command. 132 # previous command.
133 function set_prompt_symbol () { 133 function set_prompt_symbol () {
134 if test $1 -eq 0 ; then 134 if test $1 -eq 0 ; then
135 PROMPT_SYMBOL="\\$" 135 PROMPT_SYMBOL="\\$"
136 else 136 else
137 PROMPT_SYMBOL="${LIGHT_RED}\\$${COLOR_NONE}" 137 PROMPT_SYMBOL="${LIGHT_RED}\\\$${COLOR_NONE}"
138 fi 138 fi
139 } 139 }
140 140
141 # Set the full bash prompt. 141 # Set the full bash prompt.
142 function set_bash_prompt () { 142 function set_bash_prompt () {
165 esac 165 esac
166 export PS1="${debian_chroot:+($debian_chroot)}${U}\h${COLOR_NONE}:${LIGHT_BLUE}\w${COLOR_NONE}${BRANCH}${PROMPT_SYMBOL} " 166 export PS1="${debian_chroot:+($debian_chroot)}${U}\h${COLOR_NONE}:${LIGHT_BLUE}\w${COLOR_NONE}${BRANCH}${PROMPT_SYMBOL} "
167 } 167 }
168 168
169 # Tell bash to execute this function just before displaying its prompt. 169 # Tell bash to execute this function just before displaying its prompt.
170 PROMPT_COMMAND="history -a ; set_bash_prompt" 170 PROMPT_COMMAND="set_bash_prompt ; history -a"