From 163e4b62f3b4a8a55f913e32013332cefb453acc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Lundstr=C3=B6m?= Date: Wed, 7 Feb 2024 10:39:33 +0100 Subject: [PATCH] Mimic ssh(1) behaviour with host key prompt Resolves #50 --- ssh-askpass | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ssh-askpass b/ssh-askpass index a3a5377..55c0f1f 100755 --- a/ssh-askpass +++ b/ssh-askpass @@ -33,9 +33,14 @@ on run argv display dialog args with icon agent default button {get localized string of "OK"} default answer "" end if return result's text returned - else if args contains "host" then - display dialog args with icon agent buttons {"No", "Yes"} - return result's text + else if args contains " host " then + display dialog args with icon agent default button 1 cancel button 2 buttons {"OK", "No", "Yes"} default answer "" + set host_key_result to result + if text returned of host_key_result is not "" then + return text returned of host_key_result + else + return button returned of host_key_result + end if else display dialog args with icon agent default button 1 giving up after dialog_timeout if gave up of result then