diff --git a/kitty_tests/ssh.py b/kitty_tests/ssh.py index 38394b3f2..7498b79b9 100644 --- a/kitty_tests/ssh.py +++ b/kitty_tests/ssh.py @@ -167,7 +167,10 @@ copy --exclude */w.* d1 continue ok_login_shell = login_shell with self.subTest(sh=sh, login_shell=login_shell), tempfile.TemporaryDirectory() as tdir: - self.check_bootstrap(sh, tdir, login_shell) + pty = self.check_bootstrap(sh, tdir, login_shell) + if login_shell == 'bash': + pty.send_cmd_to_child('echo $HISTFILE') + pty.wait_till(lambda: '/.bash_history' in pty.screen_contents()) # check that turning off shell integration works if ok_login_shell in ('bash', 'zsh'): for val in ('', 'no-rc', 'enabled no-rc'): diff --git a/shell-integration/ssh/bootstrap.sh b/shell-integration/ssh/bootstrap.sh index c92ef9d25..38e08caf7 100644 --- a/shell-integration/ssh/bootstrap.sh +++ b/shell-integration/ssh/bootstrap.sh @@ -214,6 +214,10 @@ shell_name=$(basename $login_shell) exec_bash_with_integration() { export ENV="$shell_integration_dir/bash/kitty.bash" export KITTY_BASH_INJECT="1" + if [ -z "$HISTFILE" ]; then + export HISTFILE="$HOME/.bash_history" + export KITTY_BASH_UNEXPORT_HISTFILE="1" + fi exec "$login_shell" "--posix" }