summaryrefslogtreecommitdiff
path: root/src/shell-integration/bash
diff options
context:
space:
mode:
Diffstat (limited to 'src/shell-integration/bash')
-rw-r--r--src/shell-integration/bash/ghostty.bash6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/shell-integration/bash/ghostty.bash b/src/shell-integration/bash/ghostty.bash
index aacf37c3a..ca5a012c6 100644
--- a/src/shell-integration/bash/ghostty.bash
+++ b/src/shell-integration/bash/ghostty.bash
@@ -26,6 +26,12 @@ if [ -n "$GHOSTTY_BASH_INJECT" ]; then
builtin declare __ghostty_bash_flags="$GHOSTTY_BASH_INJECT"
builtin unset ENV GHOSTTY_BASH_INJECT
+ # Restore an existing ENV that was replaced by the shell integration code.
+ if [[ -n "$GHOSTTY_BASH_ENV" ]]; then
+ builtin export ENV=$GHOSTTY_BASH_ENV
+ builtin unset GHOSTTY_BASH_ENV
+ fi
+
# Restore bash's default 'posix' behavior. Also reset 'inherit_errexit',
# which doesn't happen as part of the 'posix' reset.
builtin set +o posix