Skip to content

Commit a4e1bc9

Browse files
davvidprati0100
authored andcommitted
git-gui: ssh-askpass: add a checkbox to show the input text
Hide the input text by default since the field is commonly used for sensative informations such as passwords. Add a "Show input" checkbox to conditionally show the input. Helped-by: Miguel Boekhold <[email protected]> Signed-off-by: Efimov Vasily <[email protected]> Signed-off-by: David Aguilar <[email protected]> Signed-off-by: Pratyush Yadav <[email protected]>
1 parent 8222c75 commit a4e1bc9

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

git-gui--askpass

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,21 @@ pack .m -side top -fill x -padx 20 -pady 20 -expand 1
2626
entry .e -textvariable answer -width 50
2727
pack .e -side top -fill x -padx 10 -pady 10
2828

29+
proc on_show_input_changed {args} {
30+
global show_input
31+
if {$show_input} {
32+
.e configure -show ""
33+
} else {
34+
.e configure -show "*"
35+
}
36+
}
37+
trace add variable show_input write "on_show_input_changed"
38+
39+
set show_input 0
40+
2941
if {!$yesno} {
30-
.e configure -show "*"
42+
checkbutton .cb_show -text "Show input" -variable show_input
43+
pack .cb_show -side top -anchor nw
3144
}
3245

3346
frame .b

0 commit comments

Comments
 (0)