2 # Tcl ignores the next line -*- tcl -*- \
5 # This is a trivial implementation of an SSH_ASKPASS handler.
6 # Git-gui uses this script if none are already configured.
13 set prompt
"Enter your OpenSSH passphrase:"
15 set prompt
[join $argv " "]
16 if {[regexp
-nocase {\
(yes\
/no\
)\?\s
*$
} $prompt]} {
21 message .m
-text $prompt -justify center
-aspect 4000
22 pack .m
-side top
-fill x
-padx 20 -pady 20 -expand 1
24 entry .e
-textvariable answer
-width 50
25 pack .e
-side top
-fill x
-padx 10 -pady 10
28 .e configure
-show "*"
32 button .b.ok
-text OK
-command finish
33 button .b.cancel
-text Cancel
-command {destroy .
}
35 pack .b.ok
-side left
-expand 1
36 pack .b.cancel
-side right
-expand 1
37 pack .b
-side bottom
-fill x
-padx 10 -pady 10
39 bind .
<Visibility
> {focus
-force .e
}
40 bind .
<Key-Return
> finish
41 bind .
<Key-Escape
> {destroy .
}
42 bind .
<Destroy
> {exit $rc}
46 if {$
::answer ne
"yes" && $
::answer ne
"no"} {
47 tk_messageBox
-icon error
-title "Error" -type ok \
48 -message "Only 'yes' or 'no' input allowed."