From 04ead526b9b94df9f67c5574b78f8063270b5fbb Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 15 Mar 2022 20:09:05 +0530 Subject: [PATCH] Presend data on slave connections since for these SSH does not use the TTY --- kittens/ssh/main.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kittens/ssh/main.py b/kittens/ssh/main.py index 592d5dbbf..221af67d4 100644 --- a/kittens/ssh/main.py +++ b/kittens/ssh/main.py @@ -599,6 +599,11 @@ def run_ssh(ssh_args: List[str], server_args: List[str], found_extra_args: Tuple need_to_request_data = False os.environ['SSH_ASKPASS_REQUIRE'] = 'force' os.environ['SSH_ASKPASS'] = os.path.join(shell_integration_dir, 'ssh', 'askpass.py') + if need_to_request_data and use_control_master: + cp = subprocess.run(cmd[:1] + ['-O', 'check'] + cmd[1:], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) + if cp.returncode == 0: + # we will use the master connection so SSH does not need to use the tty + need_to_request_data = False with restore_terminal_state() as echo_on: rcmd, replacements, shm_name = get_remote_command( remote_args, host_opts, hostname, hostname_for_match, uname, echo_on, request_data=need_to_request_data)