aboutsummaryrefslogtreecommitdiff
path: root/ksh/kshrc.d
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-12-17 18:43:54 +1300
committerTom Ryder <tom@sanctum.geek.nz>2016-12-17 18:43:54 +1300
commit7902af9a003239f0d5203e7c9d068b578e005515 (patch)
tree9f004aa6da4caa91728d48f0f66b97e6e54b5f70 /ksh/kshrc.d
parentColor Zsh prompt distinctively (diff)
downloaddotfiles-7902af9a003239f0d5203e7c9d068b578e005515.tar.gz
dotfiles-7902af9a003239f0d5203e7c9d068b578e005515.zip
Add SHLVL handling for ksh
Turns out ksh93 at least does actually do it
Diffstat (limited to 'ksh/kshrc.d')
-rw-r--r--ksh/kshrc.d/prompt.ksh8
1 files changed, 8 insertions, 0 deletions
diff --git a/ksh/kshrc.d/prompt.ksh b/ksh/kshrc.d/prompt.ksh
index f0aaadd3..8fbce020 100644
--- a/ksh/kshrc.d/prompt.ksh
+++ b/ksh/kshrc.d/prompt.ksh
@@ -35,6 +35,14 @@ 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, assuming this version
+ # of ksh does SHLVL (I think only ksh93 does it
+ typeset shlvl
+ for ((shlvl = SHLVL - TMUX_SHLVL; shlvl > 1; shlvl--)) ; do
+ PS1='>'$PS1
+ done
+
# Declare variables to contain terminal control strings
typeset format reset