{"thread":{"id":"52486","subject":"[PATCH v2] git-gui: allow closing console window with Escape","startedAt":"2019-12-18T19:58:42Z","lastAt":"2019-12-22T09:59:30Z","messageCount":2,"participants":["Pratyush Yadav"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"388473","messageId":"20191218195809.7658-1-me@yadavpratyush.com","threadId":"52486","inReplyTo":null,"subject":"[PATCH v2] git-gui: allow closing console window with Escape","fromName":"Pratyush Yadav","fromEmail":"me@yadavpratyush.com","sentAt":"2019-12-18T19:58:09Z","receivedAt":"2019-12-18T19:58:42Z","isPatch":true,"sender":{"key":"me@yadavpratyush.com","avatar":"https://avatars.githubusercontent.com/u/8817931?v=4"},"body":"This gives users a quick shortcut to close the window. But since the\nwindow can also show commands in progress, closing the window on Escape\ncan give the perception that the command has been cancelled even though\nit hasn't been. So, only enable this binding when the command is done.\n\nSigned-off-by: Pratyush Yadav <me@yadavpratyush.com>\n---\nChanges in v2:\n- Only allow closing the window on Escape when the command is done.\n\n lib/console.tcl | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/lib/console.tcl b/lib/console.tcl\nindex 1f3248f..bb6b9c8 100644\n--- a/lib/console.tcl\n+++ b/lib/console.tcl\n@@ -203,6 +203,8 @@ method done {ok} {\n \t\t\tfocus $w.ok\n \t\t}\n \t}\n+\n+\tbind $w <Key-Escape> \"destroy $w;break\"\n }\n\n method _sb_set {sb orient first last} {\n--\n2.24.1\n\n"},{"id":"388793","messageId":"20191222095921.drny6mg3h6y4l3zw@yadavpratyush.com","threadId":"52486","inReplyTo":"20191218195809.7658-1-me@yadavpratyush.com","subject":"Re: [PATCH v2] git-gui: allow closing console window with Escape","fromName":"Pratyush Yadav","fromEmail":"me@yadavpratyush.com","sentAt":"2019-12-22T09:59:21Z","receivedAt":"2019-12-22T09:59:30Z","isPatch":true,"sender":{"key":"me@yadavpratyush.com","avatar":"https://avatars.githubusercontent.com/u/8817931?v=4"},"body":"On 19/12/19 01:28AM, Pratyush Yadav wrote:\n> This gives users a quick shortcut to close the window. But since the\n> window can also show commands in progress, closing the window on Escape\n> can give the perception that the command has been cancelled even though\n> it hasn't been. So, only enable this binding when the command is done.\n> \n> Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>\n\nMerged to 'master'.\n\n-- \nRegards,\nPratyush Yadav\n"}]}