From patchwork Wed Dec 18 19:58:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pratyush Yadav X-Patchwork-Id: 11301853 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 19F761580 for ; Wed, 18 Dec 2019 19:58:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0237E2465E for ; Wed, 18 Dec 2019 19:58:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727695AbfLRT6l (ORCPT ); Wed, 18 Dec 2019 14:58:41 -0500 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:41123 "EHLO relay3-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727634AbfLRT6e (ORCPT ); Wed, 18 Dec 2019 14:58:34 -0500 X-Originating-IP: 157.36.178.182 Received: from localhost.localdomain (unknown [157.36.178.182]) (Authenticated sender: me@yadavpratyush.com) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 23CF760002; Wed, 18 Dec 2019 19:58:30 +0000 (UTC) From: Pratyush Yadav To: Cc: Vasili Novikov Subject: [PATCH v2] git-gui: allow closing console window with Escape Date: Thu, 19 Dec 2019 01:28:09 +0530 Message-Id: <20191218195809.7658-1-me@yadavpratyush.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org 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 --- Changes in v2: - Only allow closing the window on Escape when the command is done. lib/console.tcl | 2 ++ 1 file changed, 2 insertions(+) -- 2.24.1 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 "destroy $w;break" } method _sb_set {sb orient first last} {