ssh kitten: Passthrough to ssh if run outside of kitty

Also, ensure that the ssh data request is only served if it is received
over the tty of the correct kitty window.
This commit is contained in:
Kovid Goyal
2022-03-07 06:48:18 +05:30
parent e5c57a679d
commit 2404eba11f
6 changed files with 25 additions and 12 deletions

View File

@@ -97,7 +97,7 @@ class Callbacks:
def handle_remote_ssh(self, msg):
from kittens.ssh.main import get_ssh_data
if self.pty:
for line in get_ssh_data(msg):
for line in get_ssh_data(msg, "testing"):
self.pty.write_to_child(line)
def handle_remote_echo(self, msg):

View File

@@ -224,7 +224,7 @@ copy --exclude */w.* d1
else:
test_script = f'echo "UNTAR_DONE"; {test_script}'
script = bootstrap_script(
script_type='py' if 'python' in sh else 'sh',
script_type='py' if 'python' in sh else 'sh', request_id="testing",
test_script=test_script, ssh_opts_dict={'*': ssh_opts},
)
env = basic_shell_env(home_dir)