fix(shell): improve conditions for skipping interactive shell setup

This commit is contained in:
Jim Myhrberg
2025-09-16 18:03:46 +01:00
parent d04be47100
commit 50004fcb74

18
zshrc
View File

@@ -2,10 +2,20 @@
# ZSH Interactive Shell Setup # ZSH Interactive Shell Setup
# #
# If we are in VSCode's environment resolution process, we should behave as if # There's a few scenarios where we should bail from interactive shell setup, as
# this is a non-interactive shell by bailing before we load any of our # in our full interactive shell setup we have tools like `mise` and others that
# interactive shell setup. # continuously update `PATH` among other things. So scenarios that need a static
if [[ -n $VSCODE_RESOLVING_ENVIRONMENT ]]; then # environment don't play nice with this.
#
# The following scenarios are the ones we bail from:
#
# - VSCode's environment resolution process, as all it cares for it to load PATH
# and other environment variables. We specifically have tools like `mise` that
# continuously update PATH,
# - Anything that sets the `TERM` environment variable to `dumb`. This includes
# Cursor's agent setup, which is used when the agent runs terminal commands.
#
if [[ -n "$VSCODE_RESOLVING_ENVIRONMENT" ]] || [[ "$TERM" == "dumb" ]]; then
return return
fi fi