From a96c1495dc255a08370706b1ca513b5e779ae27b Mon Sep 17 00:00:00 2001 From: Julian Berman Date: Tue, 6 Jun 2023 13:31:17 -0400 Subject: [PATCH] Bind escape and q to exit without running anything. --- trogon/trogon.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/trogon/trogon.py b/trogon/trogon.py index 1238747..1160303 100644 --- a/trogon/trogon.py +++ b/trogon/trogon.py @@ -47,6 +47,7 @@ class CommandBuilder(Screen): BINDINGS = [ Binding(key="ctrl+r", action="close_and_run", description="Close & Run"), + Binding("q,escape", "close_no_run", "Close Without Running"), Binding( key="ctrl+t", action="focus_command_tree", description="Focus Command Tree" ), @@ -134,6 +135,9 @@ def action_close_and_run(self) -> None: self.app.execute_on_exit = True self.app.exit() + def action_close_no_run(self) -> None: + self.app.exit() + def action_about(self) -> None: from .widgets.about import AboutDialog