[bash] fix prompt for nested shells

We need to determine and correct the level before we build the prompt.
This commit is contained in:
Fernando Schauenburg 2018-09-20 22:31:17 +02:00
parent 98b7c1532d
commit ac3985f5b4

5
bashrc
View file

@ -157,12 +157,13 @@ bashrc_customize_terminal_colors() {
}
bashrc_customize_prompt() {
local level=$SHLVL color="$cyan" prompt=$(printf '\$%.0s' $(seq 1 $level))
local level=$SHLVL
if [[ -n "$TMUX" ]]; then
level=$(($SHLVL - 2))
fi
local color="$cyan"
local prompt=$(printf '\$%.0s' $(seq 1 $level))
if [ $EUID -eq 0 ]; then
# root user
prompt=$(printf '#%.0s' $(seq 1 $level))