diff --git a/gen-go-code.py b/gen-go-code.py index 7ecc00c52..1c1dda004 100755 --- a/gen-go-code.py +++ b/gen-go-code.py @@ -472,7 +472,7 @@ var AllowedShellIntegrationValues = []string{{ {str(sorted(allowed_shell_integra var KittyConfigDefaults = struct {{ Term, Shell_integration string }}{{ -Term: "{Options.term}", Shell_integration: "{Options.shell_integration}", +Term: "{Options.term}", Shell_integration: "{' '.join(Options.shell_integration)}", }} ''' # }}} diff --git a/kitty_tests/ssh.py b/kitty_tests/ssh.py index 94c01a21e..ea6ebe719 100644 --- a/kitty_tests/ssh.py +++ b/kitty_tests/ssh.py @@ -119,7 +119,7 @@ copy --exclude */w.* d1 self.ae(len(glob.glob(f'{remote_home}/{tname}/*/xterm-kitty')), 2) def test_ssh_env_vars(self): - tset = '$A-$(echo no)-`echo no2` !Q5 "something\nelse"' + tset = '$A-$(echo no)-`echo no2` !Q5 "something else"' for sh in self.all_possible_sh: with self.subTest(sh=sh), tempfile.TemporaryDirectory() as tdir: os.mkdir(os.path.join(tdir, 'cwd')) diff --git a/tools/cmd/ssh/main.go b/tools/cmd/ssh/main.go index 2fb6fb035..b5240bec6 100644 --- a/tools/cmd/ssh/main.go +++ b/tools/cmd/ssh/main.go @@ -217,6 +217,13 @@ func serialize_env(cd *connection_data, get_local_env func(string) (string, bool } return nil } + add_non_literal_env := func(key, val string, fallback ...string) *EnvInstruction { + ans := add_env(key, val, fallback...) + if ans != nil { + ans.literal_quote = false + } + return ans + } for k, v := range cd.literal_env { add_env(k, v) } @@ -230,9 +237,9 @@ func serialize_env(cd *connection_data, get_local_env func(string) (string, bool } else { env = append(env, &EnvInstruction{key: "KITTY_SHELL_INTEGRATION", delete_on_remote: true}) } - add_env("KITTY_SSH_KITTEN_DATA_DIR", cd.host_opts.Remote_dir) - add_env("KITTY_LOGIN_SHELL", cd.host_opts.Login_shell) - add_env("KITTY_LOGIN_CWD", cd.host_opts.Cwd) + add_non_literal_env("KITTY_SSH_KITTEN_DATA_DIR", cd.host_opts.Remote_dir) + add_non_literal_env("KITTY_LOGIN_SHELL", cd.host_opts.Login_shell) + add_non_literal_env("KITTY_LOGIN_CWD", cd.host_opts.Cwd) if cd.host_opts.Remote_kitty != Remote_kitty_no { add_env("KITTY_REMOTE", cd.host_opts.Remote_kitty.String()) } @@ -637,7 +644,7 @@ func test_integration_with_python(args []string) (rc int, err error) { cd := &connection_data{ request_id: "testing", remote_args: []string{}, username: "testuser", hostname_for_match: "host.test", request_data: true, - test_script: args[0], + test_script: args[0], echo_on: true, } opts, err := load_config(cd.hostname_for_match, cd.username, nil, f.Name()) if err == nil {