]> Sergey Matveev's repositories - zsh-autoenv.git/blobdiff - autoenv.zsh
varstash: add support for exported variables in subshells
[zsh-autoenv.git] / autoenv.zsh
index 05ac0b7d8d09e1de48ac65117977a6081d55e683..2fb77ce966da17e50d20e7000216e59e307e6dcd 100644 (file)
@@ -235,12 +235,11 @@ _autoenv_source() {
     # ${env_file:h}.
   fi
 
-  # Change to directory of env file, source it and cd back.
-  local new_dir=$PWD
+  # Source the env file.
   _autoenv_debug "== SOURCE: ${bold_color:-}$env_file${reset_color:-}\n      PWD: $PWD"
-  (( _autoenv_debug_indent++ ))
+  : $(( _autoenv_debug_indent++ ))
   source $env_file
-  (( _autoenv_debug_indent-- ))
+  : $(( _autoenv_debug_indent-- ))
   _autoenv_debug "== END SOURCE =="
 
   if [[ $autoenv_event == enter ]]; then
@@ -337,7 +336,7 @@ _autoenv_chpwd_handler() {
 
   _autoenv_chpwd_prev_dir=$PWD
 
-  (( _autoenv_debug_indent++ ))
+  : $(( _autoenv_debug_indent++ ))
 }
 # }}}