diff options
Diffstat (limited to 'etc/bash')
-rw-r--r-- | etc/bash/vcs-ps1.sh | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/etc/bash/vcs-ps1.sh b/etc/bash/vcs-ps1.sh index f2103da..4b440be 100644 --- a/etc/bash/vcs-ps1.sh +++ b/etc/bash/vcs-ps1.sh @@ -110,6 +110,19 @@ error_marker() { fi } +shell_level() { + if [ -n "${SHLVL:-}" ]; then + if [ -n "${TMUX:-}" ]; then + LVL=$((SHLVL - 1)) + else + LVL="$SHLVL" + fi + if [ "$LVL" != 1 ]; then + color -c white "[$LVL] " + fi + fi +} + timestamp() { color -c blacki '\T' } @@ -141,7 +154,7 @@ in_nix_shell() { fi } -PS1='`error_marker`'$(timestamp)' '$(path)' `repo_status``guix_env``in_nix_shell` +PS1='`error_marker`'$(timestamp)' '$(path)' `shell_level``repo_status``guix_env``in_nix_shell` $ ' |