Skip to content

Commit

Permalink
Mimic ssh(1) behaviour with host key prompt
Browse files Browse the repository at this point in the history
Resolves #50
  • Loading branch information
simmel committed Feb 7, 2024
1 parent 7054a93 commit 163e4b6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions ssh-askpass
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 163e4b6

Please sign in to comment.