diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-12-19 10:18:13 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-12-19 10:18:13 +1300 |
commit | 0a48ef9fc7c78322baef0f04f07cdc5494d88ea4 (patch) | |
tree | e2c2e856e335f8a6794335c8ffb67276c9119418 /ksh/kshrc.d | |
parent | Defer kshrc loading until after shrc all loaded (diff) | |
download | dotfiles-0a48ef9fc7c78322baef0f04f07cdc5494d88ea4.tar.gz dotfiles-0a48ef9fc7c78322baef0f04f07cdc5494d88ea4.zip |
Attempt a much saner approach to managing SHLVL
Diffstat (limited to 'ksh/kshrc.d')
-rw-r--r-- | ksh/kshrc.d/prompt.ksh | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/ksh/kshrc.d/prompt.ksh b/ksh/kshrc.d/prompt.ksh index 32bb8192..719b119f 100644 --- a/ksh/kshrc.d/prompt.ksh +++ b/ksh/kshrc.d/prompt.ksh @@ -35,15 +35,12 @@ function 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 ksh93t+ does it from what I can - # tell + # Add > symbols to show nested shells typeset shlvl - ((shlvl = SHLVL - TMUX_SHLVL)) - while ((shlvl > 1)); do + shlvl=1 + while ((shlvl < SHLVL)); do PS1='>'$PS1 - ((shlvl--)) + ((shlvl++)) done # Declare variables to contain terminal control strings |