diff --git a/dotfiles/.bashrc b/dotfiles/.bashrc index fa81624..abebe1b 100644 --- a/dotfiles/.bashrc +++ b/dotfiles/.bashrc @@ -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 diff --git a/dotfiles/.tmux.conf b/dotfiles/.tmux.conf index 0e8e85d..7bd63ec 100644 --- a/dotfiles/.tmux.conf +++ b/dotfiles/.tmux.conf @@ -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