Dont leak the ENV environ var we use to load our integration script into the shell

This commit is contained in:
Kovid Goyal 2022-02-22 21:29:32 +05:30
parent 88091b4ab3
commit 0108037076
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -34,9 +34,11 @@ _ksi_main() {
} }
if [[ -n "$KITTY_BASH_INJECT" ]]; then if [[ -n "$KITTY_BASH_INJECT" ]]; then
builtin unset ENV;
if [[ "$KITTY_BASH_INJECT" == *"posix"* ]]; then if [[ "$KITTY_BASH_INJECT" == *"posix"* ]]; then
if [[ -n "$KITTY_BASH_POSIX_ENV" && -r "$KITTY_BASH_POSIX_ENV" ]]; then if [[ -n "$KITTY_BASH_POSIX_ENV" && -r "$KITTY_BASH_POSIX_ENV" ]]; then
builtin source "$KITTY_BASH_POSIX_ENV"; builtin source "$KITTY_BASH_POSIX_ENV";
export ENV="$KITTY_BASH_POSIX_ENV";
fi fi
else else
set +o posix; set +o posix;