aboutsummaryrefslogtreecommitdiff
path: root/zsh/zshrc
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-12-09 23:24:42 +1300
committerTom Ryder <tom@sanctum.geek.nz>2016-12-09 23:24:42 +1300
commit026944e99a9ab1fe2934d3e6a7e9fea013a20e41 (patch)
treee8b504145b64a68ccef23c09c17d9251c5dd36b8 /zsh/zshrc
parentCorrect uts(1df) manual (diff)
downloaddotfiles-026944e99a9ab1fe2934d3e6a7e9fea013a20e41.tar.gz
dotfiles-026944e99a9ab1fe2934d3e6a7e9fea013a20e41.zip
Port prompt SHLVL behaviour to zsh
Diffstat (limited to 'zsh/zshrc')
-rw-r--r--zsh/zshrc7
1 files changed, 7 insertions, 0 deletions
diff --git a/zsh/zshrc b/zsh/zshrc
index 2376e568..6edcdb67 100644
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -7,6 +7,13 @@ HISTFILE=$HOME/.zsh_history
SAVEHIST=$((1 << 12))
HISTSIZE=$((1 << 10))
+# Set a SHLVL-derived value that takes tmux into account. This is used to show
+# the current SHLVL in the prompt
+if [[ -n $TMUX && -z $TMUX_SHLVL ]] ; then
+ TMUX_SHLVL=$((SHLVL - 1))
+ export TMUX_SHLVL
+fi
+
# Load POSIX shell startup files and then Bash-specific ones
for sh in "$ENV" "$HOME"/.zshrc.d/*.zsh ; do
[[ -e $sh ]] && source "$sh"