From 7902af9a003239f0d5203e7c9d068b578e005515 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 17 Dec 2016 18:43:54 +1300 Subject: Add SHLVL handling for ksh Turns out ksh93 at least does actually do it --- ksh/kshrc.d/prompt.ksh | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'ksh/kshrc.d/prompt.ksh') 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 -- cgit v1.2.3