bash: render prompt in the same color as separators
This commit is contained in:
parent
f1ba6be31c
commit
8fb66ffa6c
1 changed files with 4 additions and 4 deletions
|
@ -126,8 +126,8 @@ PS2="... "
|
||||||
__ps1_set() {
|
__ps1_set() {
|
||||||
local exit=$?
|
local exit=$?
|
||||||
local prompt=">>>>>>>>>>"
|
local prompt=">>>>>>>>>>"
|
||||||
local sep="$PS1_SEP_DARK$PS1_SEP"
|
local sep_color="$PS1_SEP_DARK"
|
||||||
[ "$BACKGROUND" = "light" ] && sep="$PS1_SEP_LIGHT$PS1_SEP"
|
[ "$BACKGROUND" = "light" ] && sep_color="$PS1_SEP_LIGHT"
|
||||||
|
|
||||||
local ps=()
|
local ps=()
|
||||||
[ $exit -ne 0 ] && ps+=("$PS1_EXIT$exit")
|
[ $exit -ne 0 ] && ps+=("$PS1_EXIT$exit")
|
||||||
|
@ -139,8 +139,8 @@ __ps1_set() {
|
||||||
local j="\j" && [ "${j@P}" -gt 0 ] && ps+=("$PS1_JOBS${j@P} bg")
|
local j="\j" && [ "${j@P}" -gt 0 ] && ps+=("$PS1_JOBS${j@P} bg")
|
||||||
|
|
||||||
local extra=""
|
local extra=""
|
||||||
[ ${#ps[@]} -gt 1 ] && printf -v extra "$sep%s" "${ps[@]:1}"
|
[ ${#ps[@]} -gt 1 ] && printf -v extra "$sep_color$PS1_SEP%s" "${ps[@]:1}"
|
||||||
PS1="${ps[0]}$extra$Reset ${prompt:0:$SHLVL} "
|
PS1="${ps[0]}$extra$sep_color ${prompt:0:$SHLVL}$Reset "
|
||||||
} &>/dev/null
|
} &>/dev/null
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
Loading…
Add table
Reference in a new issue