From 829ed0ec0d4db169403fbe27fc8bd6415177709e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 14 Apr 2022 17:20:30 +0530 Subject: [PATCH] Fix #4964 --- docs/changelog.rst | 2 ++ shell-integration/bash/kitty.bash | 3 +++ 2 files changed, 5 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index d595671bb..a4ff42511 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -45,6 +45,8 @@ Detailed list of changes - Allow using the cwd of the oldest as well as the newest foreground process for :option:`launch --cwd` (:disc:`4869`) +- Bash integration: Fix the value of :opt:`shell_integration` not taking effect if the integration script is sourced in bashrc (:pull:`4964`) + 0.25.0 [2022-04-11] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/shell-integration/bash/kitty.bash b/shell-integration/bash/kitty.bash index 8df7ebc33..1b3d66f19 100644 --- a/shell-integration/bash/kitty.bash +++ b/shell-integration/bash/kitty.bash @@ -7,6 +7,8 @@ _ksi_inject() { # Load the normal bash startup files if [[ -n "$KITTY_BASH_INJECT" ]]; then builtin local kitty_bash_inject="$KITTY_BASH_INJECT" + builtin local ksi_val="$KITTY_SHELL_INTEGRATION" + builtin unset KITTY_SHELL_INTEGRATION # ensure manual sourcing of this file in bashrc does not have any effect builtin unset KITTY_BASH_INJECT builtin unset ENV if [[ -z "$HOME" ]]; then HOME=~; fi @@ -52,6 +54,7 @@ _ksi_inject() { builtin unset KITTY_BASH_POSIX_ENV builtin unset KITTY_BASH_ETC_LOCATION builtin unset -f _ksi_safe_source + export KITTY_SHELL_INTEGRATION="$ksi_val" fi } _ksi_inject