git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] git-gui: allow closing console window with Escape
@ 2019-12-18 19:58 Pratyush Yadav
  2019-12-22  9:59 ` Pratyush Yadav
  0 siblings, 1 reply; 2+ messages in thread
From: Pratyush Yadav @ 2019-12-18 19:58 UTC (permalink / raw)
  To: git; +Cc: Vasili Novikov

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] git-gui: allow closing console window with Escape
  2019-12-18 19:58 [PATCH v2] git-gui: allow closing console window with Escape Pratyush Yadav
@ 2019-12-22  9:59 ` Pratyush Yadav
  0 siblings, 0 replies; 2+ messages in thread
From: Pratyush Yadav @ 2019-12-22  9:59 UTC (permalink / raw)
  To: git; +Cc: Vasili Novikov

On 19/12/19 01:28AM, Pratyush Yadav wrote:
> 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>

Merged to 'master'.

-- 
Regards,
Pratyush Yadav

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-12-22  9:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-18 19:58 [PATCH v2] git-gui: allow closing console window with Escape Pratyush Yadav
2019-12-22  9:59 ` Pratyush Yadav

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).