git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2] git-gui: allow closing console window with Escape

From
Pratyush Yadav <me@yadavpratyush.com>
Date
Dec 18, 2019, 19:58 UTC
Message-ID
<20191218195809.7658-1-me@yadavpratyush.com>

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>
---
Changes in v2:
- Only allow closing the window on Escape when the command is done.
 lib/console.tcl | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/lib/console.tcl b/lib/console.tcl
index 1f3248f..bb6b9c8 100644
--- a/lib/console.tcl
+++ b/lib/console.tcl
@@ -203,6 +203,8 @@ method done {ok} {
 			focus $w.ok
 		}
 	}
+
+	bind $w <Key-Escape> "destroy $w;break"
 }

 method _sb_set {sb orient first last} {
--
2.24.1
Next: Pratyush Yadav
Message 1 of 2 in “git-gui: allow closing console window with Escape”
  1. git-gui: allow closing console window with EscapePratyush Yadav, Dec 18, 2019
  2. Pratyush YadavDec 22, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.