aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-11-30 10:48:14 +1300
committerTom Ryder <tom@sanctum.geek.nz>2016-11-30 10:48:14 +1300
commit8b4f5774b59398b964e9dce0866068f14744d631 (patch)
treebff19be02fc68063d9fb0c7f7eb22916d224c228 /bash/bashrc.d
parentOnly add > starting from SHLVL=2 (diff)
downloaddotfiles-8b4f5774b59398b964e9dce0866068f14744d631.tar.gz
dotfiles-8b4f5774b59398b964e9dce0866068f14744d631.zip
Handle tmux sessions showing SHLVL properly
Diffstat (limited to 'bash/bashrc.d')
-rw-r--r--bash/bashrc.d/prompt.bash6
1 files changed, 3 insertions, 3 deletions
diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash
index 84cdf584..7058f4c3 100644
--- a/bash/bashrc.d/prompt.bash
+++ b/bash/bashrc.d/prompt.bash
@@ -32,9 +32,9 @@ prompt() {
PS1=$PS1'\$'
# Add > signs at the front of the prompt to show the current shell
- # level
- local i
- for ((i = 1; i < SHLVL; i++)) ; do
+ # level, taking tmux sessions into account
+ local shlvl
+ for ((shlvl = SHLVL - TMUX_SHLVL; shlvl > 1; shlvl--)) ; do
PS1='>'$PS1
done