Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bind escape and q to exit without running anything #40

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions trogon/trogon.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
),
Expand Down Expand Up @@ -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

Expand Down