aboutsummaryrefslogtreecommitdiff
path: root/zsh/zshrc.d
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.d
parentCorrect uts(1df) manual (diff)
downloaddotfiles-026944e99a9ab1fe2934d3e6a7e9fea013a20e41.tar.gz
dotfiles-026944e99a9ab1fe2934d3e6a7e9fea013a20e41.zip
Port prompt SHLVL behaviour to zsh
Diffstat (limited to 'zsh/zshrc.d')
-rw-r--r--zsh/zshrc.d/prompt.zsh7
1 files changed, 7 insertions, 0 deletions
diff --git a/zsh/zshrc.d/prompt.zsh b/zsh/zshrc.d/prompt.zsh
index ca5ecf3e..0ac2be55 100644
--- a/zsh/zshrc.d/prompt.zsh
+++ b/zsh/zshrc.d/prompt.zsh
@@ -32,6 +32,13 @@ prompt() {
# Add terminating "$" or "#" sign
PS1=$PS1'%#'
+ # Add > signs at the front of the prompt to show the current shell
+ # level, taking tmux sessions into account
+ local shlvl
+ for ((shlvl = SHLVL - TMUX_SHLVL; shlvl > 1; shlvl--)) ; do
+ PS1='>'$PS1
+ done
+
# Bold and color the prompt if it looks like we can
if (( $({ tput colors || tput Co ; } 2>/dev/null) >= 8 )) ; then
PS1='%B%F{green}'$PS1'%f%b'