bash: narrow the scope of GHOSTTY_BASH_ENV (#4690)

GHOSTTY_BASH_ENV is only set in the '--posix' path. This change is a
code organization improvement and doesn't change the script's behavior.
pull/4742/head
Mitchell Hashimoto 2025-01-06 16:01:41 -08:00 committed by GitHub
commit 1cf1b886cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -24,6 +24,7 @@ if [ -n "$GHOSTTY_BASH_INJECT" ]; then
builtin source "$GHOSTTY_BASH_ENV" builtin source "$GHOSTTY_BASH_ENV"
builtin export ENV="$GHOSTTY_BASH_ENV" builtin export ENV="$GHOSTTY_BASH_ENV"
fi fi
builtin unset GHOSTTY_BASH_ENV
else else
# Restore bash's default 'posix' behavior. Also reset 'inherit_errexit', # Restore bash's default 'posix' behavior. Also reset 'inherit_errexit',
# which doesn't happen as part of the 'posix' reset. # which doesn't happen as part of the 'posix' reset.
@ -64,7 +65,7 @@ if [ -n "$GHOSTTY_BASH_INJECT" ]; then
fi fi
fi fi
builtin unset GHOSTTY_BASH_ENV GHOSTTY_BASH_RCFILE builtin unset GHOSTTY_BASH_RCFILE
builtin unset ghostty_bash_inject rcfile builtin unset ghostty_bash_inject rcfile
fi fi