git-gui: allow closing console window with Escape
authorPratyush Yadav <me@yadavpratyush.com>
Fri, 6 Dec 2019 21:46:31 +0000 (03:16 +0530)
committerPratyush Yadav <me@yadavpratyush.com>
Wed, 18 Dec 2019 19:52:53 +0000 (01:22 +0530)
This gives users a quick shortcut to close the window. But since the
window can also show commands in progress, closing the window on Escape
can give the perception that the command has been cancelled even though
it hasn't been. So, only enable this binding when the command is done.

Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
lib/console.tcl

index 1f3248f..bb6b9c8 100644 (file)
@@ -203,6 +203,8 @@ method done {ok} {
                        focus $w.ok
                }
        }
+
+       bind $w <Key-Escape> "destroy $w;break"
 }
 
 method _sb_set {sb orient first last} {