save_as_session: Preserve remote cwd when saving ssh kitten cmdline

This commit is contained in:
Kovid Goyal
2025-08-22 20:59:52 +05:30
parent 1a25ca1545
commit eacc985c28

View File

@@ -2028,6 +2028,10 @@ class Window:
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: