[zsh] don't sync the cwd when a terminal is opened inside vscode (requested by @lexisother)

This commit is contained in:
Dmytro Meleshko 2021-06-21 19:00:00 +03:00
parent 0597f8fde9
commit 9a1a338262

View file

@ -65,6 +65,20 @@ if [[ -z "$DOTFILES_DISABLE_WELCOME" ]]; then
welcome
fi
if [[ -z "$DOTFILES_SYNC_LAST_WORKING_DIR" ]]; then
should_really_sync=0
if [[ -v DOTFILES_SYNC_LAST_WORKING_DIR ]]; then
# Variable is defined
if [[ -n "$DOTFILES_SYNC_LAST_WORKING_DIR" ]]; then
# Variable is non-empty
should_really_sync=1
fi
else
# Variable is undefined
if [[ "$TERM_PROGRAM" != "vscode" ]]; then
should_really_sync=1
fi
fi
if (( should_really_sync )); then
sync_working_dir_load
fi
unset should_really_sync