From 7d4f61d385c3638475e673b8ee45dd4c50c54402 Mon Sep 17 00:00:00 2001 From: 10sr <8.slashes@gmail.com> Date: Tue, 18 Apr 2023 19:29:35 +0900 Subject: [PATCH] Update SHLVL --- shrc | 8 ++++---- tmux.conf | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/shrc b/shrc index 7b09e99..afd5df4 100755 --- a/shrc +++ b/shrc @@ -1046,11 +1046,11 @@ __my_ps1_jobs(){ } __my_ps1_dollar(){ - if test -z "$SHLVL" + if test -z "$2" then printf "$1" else - perl -e 'while($ARGV[0]-- > 0){print "$ARGV[1]";}' $SHLVL "$1" + perl -e 'while($ARGV[0]-- > 0){print "$ARGV[1]";}' "$2" "$1" fi } @@ -1172,13 +1172,13 @@ if $inzsh then PROMPT="\ ${__my_ps1_beg}[${__my_c2}%n@%M${__my_cdef}:${__my_c1}%~/${__my_cdef}]\$(__my_ps1_info1) -${__my_ps1_beg}\$(__my_ps1_info2) $(__my_ps1_dollar %#) " +${__my_ps1_beg}\$(__my_ps1_info2) $(__my_ps1_dollar %# $SHLVL) " RPROMPT="%D{%Y/%m/%d %H:%M}" elif $inbash then PS1="\ ${__my_ps1_beg}[${__my_c2}\u@\H${__my_cdef}:${__my_c1}\w/${__my_cdef}]\$(__my_ps1_info1)\n\ -${__my_ps1_beg}\D{%Y/%m/%d %H:%M} \$(__my_ps1_info2)${__my_ps1_right} $(__my_ps1_dollar \\$) " +${__my_ps1_beg}\D{%Y/%m/%d %H:%M} \$(__my_ps1_info2)${__my_ps1_right} $(__my_ps1_dollar \\$ $SHLVL) " else true # PS1="$(printf $(whoami)@$(hostname)$ )" diff --git a/tmux.conf b/tmux.conf index c5ad78d..8858ed6 100644 --- a/tmux.conf +++ b/tmux.conf @@ -29,7 +29,7 @@ setw -g mode-keys vi #setw -g mode-mouse off #set -g default-command /bin/bash # Use C-z x to kill window -set -g default-command "while true; do /bin/bash -l; done" +set -g default-command "while true; do env SHLVL= /bin/bash -l; done" # Use pasteboard on MacOS run-shell 'test "`uname`" = Darwin && tmux bind-key -T copy-mode-vi "Enter" send-keys -X copy-pipe-and-cancel "pbcopy"'