From eacc985c281c845cf060c742835b8eb30838c3e3 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 22 Aug 2025 20:59:52 +0530 Subject: [PATCH] save_as_session: Preserve remote cwd when saving ssh kitten cmdline --- kitty/window.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kitty/window.py b/kitty/window.py index 02cc5cd4e..0284b643b 100644 --- a/kitty/window.py +++ b/kitty/window.py @@ -2028,6 +2028,10 @@ def make_exe_absolute(cmd: list[str], pid: int) -> None: cmd[0] = abspath_of_exe(pid) kssh_cmdline = self.ssh_kitten_cmdline() if kssh_cmdline: + from kittens.ssh.utils import set_cwd_in_cmdline + if self.at_prompt: + if self.screen.last_reported_cwd: + set_cwd_in_cmdline(path_from_osc7_url(self.screen.last_reported_cwd), kssh_cmdline) unserialize_data['cmd_at_shell_startup'] = kssh_cmdline elif not self.at_prompt: if self.last_cmd_cmdline: