From 76de99a5a885b467e63a53e7952499f0fbac8b7f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 11 Mar 2022 16:18:34 +0530 Subject: [PATCH] Use a custom askpass implementation Keeps OpenSSH from using the tty hopefully allowing us to start sending data without needing to wait for the remote side to request it. --- kittens/ssh/main.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kittens/ssh/main.py b/kittens/ssh/main.py index 88044df7d..58a24bcd6 100644 --- a/kittens/ssh/main.py +++ b/kittens/ssh/main.py @@ -523,6 +523,11 @@ def main(args: List[str]) -> NoReturn: cmd += rcmd if use_control_master: cmd[insertion_point:insertion_point] = connection_sharing_args(host_opts, int(os.environ['KITTY_PID'])) + # We force use of askpass so that OpenSSH does not use the tty leaving + # it free for us to use + os.environ['SSH_ASKPASS_REQUIRE'] = 'force' + if not os.environ.get('SSH_ASKPASS'): + os.environ['SSH_ASKPASS'] = os.path.join(shell_integration_dir, 'ssh', 'askpass.py') import subprocess with suppress(FileNotFoundError): try: