feat(PS1): add shell level
This commit is contained in:
parent
244c4240ce
commit
8d3e08569a
1 changed files with 6 additions and 1 deletions
|
@ -18,7 +18,12 @@ set_prompt() {
|
|||
STATUS="$FAILED"
|
||||
fi
|
||||
|
||||
PS1="╭╴$USER_COLOR\u$HOST_COLOR@\h$BRANCH$WHITE:$PURPLE\w$WHITE $STATUS\n╰╴$ "
|
||||
LEVEL=""
|
||||
if [ $SHLVL -gt 1 ]; then
|
||||
LEVEL="shellDepth=\$((SHLVL-1))"
|
||||
fi
|
||||
|
||||
PS1="╭╴$USER_COLOR\u$HOST_COLOR@\h$BRANCH$WHITE:$PURPLE\w$WHITE $LEVEL $STATUS\n╰╴$ "
|
||||
}
|
||||
|
||||
PROMPT_COMMAND="set_prompt \$?; history -a"
|
||||
|
|
Loading…
Reference in a new issue