commit 1e64f062e0cb06d50c54089b2e1b9de97cfa4cb4
parent 8d7645900248f74b61a4822cc77c1c01784e6854
Author: Alex Balgavy <a.balgavy@gmail.com>
Date: Mon, 27 Apr 2020 16:28:25 +0200
p10k shell level indicator
Former-commit-id: bed5c271847481426770727cee42899f5b735a5b
Diffstat:
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/shell/p10k-dark.zsh b/shell/p10k-dark.zsh
@@ -1140,7 +1140,12 @@
# local lvl='${${_my_lvl::=${${TMUX:+$((SHLVL-1))}:-$SHLVL}}+}'
# p10k segment -f 4 -e -t $lvl'%B${(l:$_my_lvl::$_my_lvl:)}%(1j.%j.)'
# These ^ are cool functions but overkill for me
- local lvl=$(if [ $SHLVL -gt 1 ]; then printf "(L$SHLVL)"; else printf ""; fi)
+ local lvl="";
+ if [ $SHLVL -gt 1 ]; then
+ if [ $SHLVL -gt 2 ] || ( [ -z "$VIMRUNTIME" ] && [ -z "$TMUX" ] ); then
+ lvl="(L$SHLVL)"
+ fi
+ fi
p10k segment -f 4 -t "$lvl"
}
diff --git a/shell/p10k-light.zsh b/shell/p10k-light.zsh
@@ -1276,7 +1276,12 @@
# local lvl='${${_my_lvl::=${${TMUX:+$((SHLVL-1))}:-$SHLVL}}+}'
# p10k segment -f 4 -e -t $lvl'%B${(l:$_my_lvl::$_my_lvl:)}%(1j.%j.)'
# These ^ are cool functions but overkill for me
- local lvl=$(if [ $SHLVL -gt 1 ]; then printf "(L$SHLVL)"; else printf ""; fi)
+ local lvl="";
+ if [ $SHLVL -gt 1 ]; then
+ if [ $SHLVL -gt 2 ] || ( [ -z "$VIMRUNTIME" ] && [ -z "$TMUX" ] ); then
+ lvl="(L$SHLVL)"
+ fi
+ fi
p10k segment -f 4 -t "$lvl"
}