From 19625196667201db38f577bbaece718b05f6ed7a Mon Sep 17 00:00:00 2001 From: pagedown Date: Thu, 17 Mar 2022 22:23:48 +0800 Subject: [PATCH] Only write to the OpenSSH version sentinel file once --- kittens/ssh/main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kittens/ssh/main.py b/kittens/ssh/main.py index 0c8e66b7b..6e3ecbbe0 100644 --- a/kittens/ssh/main.py +++ b/kittens/ssh/main.py @@ -602,8 +602,10 @@ def run_ssh(ssh_args: List[str], server_args: List[str], found_extra_args: Tuple need_to_request_data = True if use_kitty_askpass: sentinel = os.path.join(cache_dir(), 'openssh-is-new-enough-for-askpass') - if os.path.exists(sentinel) or ssh_version() >= (8, 4): - open(sentinel, 'w').close() + sentinel_exists = os.path.exists(sentinel) + if sentinel_exists or ssh_version() >= (8, 4): + if not sentinel_exists: + open(sentinel, 'w').close() # SSH_ASKPASS_REQUIRE was introduced in 8.4 release on 2020-09-27 need_to_request_data = False os.environ['SSH_ASKPASS_REQUIRE'] = 'force'