Fix spacing when error is shown

This commit is contained in:
2025-04-29 15:56:50 +08:00
parent e903a3a256
commit 1a943907db

View File

@@ -75,10 +75,10 @@ esac
# Add goodies to PS1 # Add goodies to PS1
export BASE_PS1="$PS1" export BASE_PS1="$PS1"
export BASE_PS1="$(echo "$BASE_PS1" | sed 's!\\\$ $!!g')" export BASE_PS1="$(echo "$BASE_PS1" | sed 's!\\\$ $!!g')"
export BASE_PS1_END='\$ ' export BASE_PS1_END=' \$ '
# show return value if prompt is nonzero # show return value if prompt is nonzero
export BASH_GOODIES_RETURNVAL='$([ "$?" = 0 ] && echo "" || echo " \e[31m\][$?]\[\e[0m\] ")' export BASH_GOODIES_RETURNVAL='$([ "$?" = 0 ] && echo "" || echo " \e[31m\][$?]\[\e[0m\]")'
PS1="${BASE_PS1}${BASH_GOODIES_RETURNVAL}${BASE_PS1_END}" PS1="${BASE_PS1}${BASH_GOODIES_RETURNVAL}${BASE_PS1_END}"
# enable color support of ls and also add handy aliases # enable color support of ls and also add handy aliases