aboutsummaryrefslogtreecommitdiff
path: root/core/bash
diff options
context:
space:
mode:
Diffstat (limited to 'core/bash')
-rw-r--r--core/bash/prompt.sh10
1 files changed, 7 insertions, 3 deletions
diff --git a/core/bash/prompt.sh b/core/bash/prompt.sh
index bae2237..965afe2 100644
--- a/core/bash/prompt.sh
+++ b/core/bash/prompt.sh
@@ -45,14 +45,18 @@ function prompt.git {
function prompt.prepare {
local err=$?
PS1='\n'
-
+
local subshell=''
+ local base_shlvl=1
+ if [[ "$TERM_PROGRAM" == 'vscode' ]]; then base_shlvl=2; fi
+ local shlvl=$((SHLVL-base_shlvl))
+
if [[ -n "$IN_NIX_SHELL" ]]; then
subshell="\\[\e[33m\\]nix"
fi
- if [[ $SHLVL != 1 && ! ($SHLVL == 2 && -n "$IN_NIX_SHELL") ]]; then
+ if [[ $shlvl != 0 && ! ($shlvl == 1 && -n "$IN_NIX_SHELL") ]]; then
if [[ -n "$subshell" ]]; then subshell+="\\[\e[39m\\] "; fi
- subshell+="\\[\e[2;37m\\]$SHLVL"
+ subshell+="\\[\e[2;37m\\]$shlvl"
fi
if [[ -n "$subshell" ]]; then
PS1+="$(prompt.bubble "$subshell") "