From a967e3ac641c346bd4b35aca9a56707697b58c4d Mon Sep 17 00:00:00 2001 From: Darren Burns Date: Sat, 10 Aug 2024 15:06:04 +0100 Subject: [PATCH] New quit key, add quit to command palette --- src/posting/app.py | 7 ++++++- src/posting/commands.py | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/posting/app.py b/src/posting/app.py index af0847e3..6afb7fe5 100644 --- a/src/posting/app.py +++ b/src/posting/app.py @@ -568,7 +568,7 @@ def response_trace(self) -> ResponseTrace: return self.query_one(ResponseTrace) -class Posting(App[None]): +class Posting(App[None], inherit_bindings=False): AUTO_FOCUS = None COMMANDS = {PostingProvider} CSS_PATH = Path(__file__).parent / "posting.scss" @@ -583,6 +583,11 @@ class Posting(App[None]): "toggle_jump_mode", description="Jump", ), + Binding( + "ctrl+q", + "app.quit", + description="Quit", + ), Binding("f1,ctrl+question_mark", "help", "Help"), Binding("f8", "save_screenshot", "Save screenshot", show=False), ] diff --git a/src/posting/commands.py b/src/posting/commands.py index 1013cff0..ebe99f07 100644 --- a/src/posting/commands.py +++ b/src/posting/commands.py @@ -17,6 +17,7 @@ def commands( commands_to_show: list[tuple[str, IgnoreReturnCallbackType, str]] = [ *self.get_theme_commands(), + ("app: quit", app.action_quit, "Quit Posting"), ] from posting.app import MainScreen