feat: new option --hold-after-ssh to allow spawning a shell after a kitten ssh disconnection

new option to the launch command, the new shell will be in the directory
that launched kitten ssh
This commit is contained in:
Barr
2025-07-11 18:34:21 +03:00
parent 564195f94f
commit ca2232e435
5 changed files with 30 additions and 8 deletions

View File

@@ -221,6 +221,7 @@ class Child:
hold: bool = False,
pass_fds: tuple[int, ...] = (),
remote_control_fd: int = -1,
hold_after_ssh: bool = False
):
self.is_clone_launch = is_clone_launch
self.id = next(child_counter)
@@ -230,7 +231,7 @@ class Child:
self.remote_control_fd = remote_control_fd
if cwd_from:
try:
cwd = cwd_from.modify_argv_for_launch_with_cwd(self.argv, env) or cwd
cwd = cwd_from.modify_argv_for_launch_with_cwd(self.argv, env, hold_after_ssh=hold_after_ssh) or cwd
except Exception as err:
log_error(f'Failed to read cwd of {cwd_from} with error: {err}')
else: