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
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -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: