From b65a5f78fdaaa31a74b6f1e1165eed04402a33da Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 11 Feb 2024 15:29:32 +0530 Subject: [PATCH] Fix regression causing shells in darwin to not run in login mode --- kitty_tests/shell_integration.py | 1 + tools/tui/run.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/kitty_tests/shell_integration.py b/kitty_tests/shell_integration.py index b5946ad41..5ba56919c 100644 --- a/kitty_tests/shell_integration.py +++ b/kitty_tests/shell_integration.py @@ -90,6 +90,7 @@ class ShellIntegration(BaseTest): cmd = cmd or shell cmd = shlex.split(cmd.format(**locals())) env = (setup_env or safe_env_for_running_shell)(cmd, home_dir, rc=rc, shell=shell, with_kitten=self.with_kitten) + env['KITTY_RUNNING_SHELL_INTEGRATION_TEST'] = '1' try: if self.with_kitten: cmd = [kitten_exe(), 'run-shell', '--shell', shlex.join(cmd)] diff --git a/tools/tui/run.go b/tools/tui/run.go index 61315bc01..50b713ea0 100644 --- a/tools/tui/run.go +++ b/tools/tui/run.go @@ -163,7 +163,7 @@ func RunShell(shell_cmd []string, shell_integration_env_var_val, cwd string) (er shell_env = env } exe := shell_cmd[0] - if runtime.GOOS == "darwin" && os.Getenv("KITTY_RUNNING_BASH_INTEGRATION_TEST") != "" { + if runtime.GOOS == "darwin" && (os.Getenv("KITTY_RUNNING_SHELL_INTEGRATION_TEST") != "1" || os.Getenv("KITTY_RUNNING_BASH_INTEGRATION_TEST") != "") { // ensure shell runs in login mode. On macOS lots of people use ~/.bash_profile instead of ~/.bashrc // which means they expect the shell to run in login mode always. Le Sigh. shell_cmd[0] = "-" + filepath.Base(shell_cmd[0])