From 50004fcb74a0dce72a42da46be268ff405b04ad7 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Tue, 16 Sep 2025 18:03:46 +0100 Subject: [PATCH] fix(shell): improve conditions for skipping interactive shell setup --- zshrc | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/zshrc b/zshrc index 831d155..42e21d1 100644 --- a/zshrc +++ b/zshrc @@ -2,10 +2,20 @@ # ZSH Interactive Shell Setup # -# If we are in VSCode's environment resolution process, we should behave as if -# this is a non-interactive shell by bailing before we load any of our -# interactive shell setup. -if [[ -n $VSCODE_RESOLVING_ENVIRONMENT ]]; then +# There's a few scenarios where we should bail from interactive shell setup, as +# in our full interactive shell setup we have tools like `mise` and others that +# continuously update `PATH` among other things. So scenarios that need a static +# 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 fi