Fix SHLVL in tmux
This commit is contained in:
parent
a13a965961
commit
8da84cdc64
2 changed files with 4 additions and 7 deletions
|
@ -185,12 +185,7 @@ bashrc_customize_terminal_colors() {
|
|||
|
||||
bashrc_set_prompt() {
|
||||
local exit_code=$?
|
||||
|
||||
local level=$SHLVL
|
||||
if [[ -n "$TMUX" ]]; then
|
||||
level=$(($SHLVL - 2))
|
||||
fi
|
||||
|
||||
local prompt=$(printf '\$%.0s' $(seq 1 $level))
|
||||
local color="$cyan"
|
||||
if [ $EUID -eq 0 ]; then
|
||||
|
|
|
@ -44,8 +44,10 @@ set -g status-justify centre
|
|||
set -g status-left '@#h ⧉ #S' # @host ⧉session
|
||||
set -g status-right '%Y-%m-%d %a %H:%M' # date, weekday, time
|
||||
|
||||
# Make sure we always start at 1, even when invoked from a wrapper script
|
||||
set-environment -g SHLVL 1
|
||||
# The shell will increment SHLVL by one when it is started -> unsetting this
|
||||
# variable here removes any memory of nesting before tmux was executed and will
|
||||
# cause shells to start with level 1 again within the session.
|
||||
set-environment -gu SHLVL
|
||||
|
||||
#
|
||||
# Colors
|
||||
|
|
Loading…
Add table
Reference in a new issue