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.
This commit is contained in:
Kovid Goyal 2022-03-11 16:18:34 +05:30
parent 8613c6e1cd
commit 76de99a5a8
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -523,6 +523,11 @@ def main(args: List[str]) -> NoReturn:
cmd += rcmd cmd += rcmd
if use_control_master: if use_control_master:
cmd[insertion_point:insertion_point] = connection_sharing_args(host_opts, int(os.environ['KITTY_PID'])) 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 import subprocess
with suppress(FileNotFoundError): with suppress(FileNotFoundError):
try: try: