git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Pratyush Yadav <me@yadavpratyush.com>
To: <git@vger.kernel.org>
Cc: Vasili Novikov <vasilii.novikov@zivver.com>
Subject: [PATCH v2] git-gui: allow closing console window with Escape
Date: Thu, 19 Dec 2019 01:28:09 +0530	[thread overview]
Message-ID: <20191218195809.7658-1-me@yadavpratyush.com> (raw)

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


             reply	other threads:[~2019-12-18 19:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-18 19:58 Pratyush Yadav [this message]
2019-12-22  9:59 ` [PATCH v2] git-gui: allow closing console window with Escape Pratyush Yadav

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191218195809.7658-1-me@yadavpratyush.com \
    --to=me@yadavpratyush.com \
    --cc=git@vger.kernel.org \
    --cc=vasilii.novikov@zivver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).