From 88ee8c746309d68891125ed99e16ab1db54635cc Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Thu, 4 Apr 2024 22:25:48 +0200 Subject: [PATCH] Get back Esc binding Apparently after switching to termion (from default ncurses) backend it fully functional, or maybe that was a different terminal... For now I checked alacritty and konsole and both are OK. Refs: https://github.com/azat/chdig/issues/50 --- Documentation/FAQ.md | 1 + src/view/navigation.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/FAQ.md b/Documentation/FAQ.md index 6cc70cf..91b48c4 100644 --- a/Documentation/FAQ.md +++ b/Documentation/FAQ.md @@ -50,6 +50,7 @@ highly not recommended), you can use `chdig --connection prod`. | | | CPU Server Flamegraph in speedscope | | | **~** | chdig debug console | | | **q** | Back/Quit | +| | **Esc** | Back/Quit | | | **Q** | Quit forcefully | | | **Backspace** | Back | | | **p** | Toggle pause | diff --git a/src/view/navigation.rs b/src/view/navigation.rs index 27a9f28..f0df5ee 100644 --- a/src/view/navigation.rs +++ b/src/view/navigation.rs @@ -294,7 +294,7 @@ impl Navigation for Cursive { '~', toggle_flexi_logger_debug_console, ); - // NOTE: Do not bind to Esc, since this breaks other bindings (Home/End/...) + context.add_global_action(self, "Back/Quit", Key::Esc, |siv| siv.pop_ui(true)); context.add_global_action(self, "Back/Quit", 'q', |siv| siv.pop_ui(true)); context.add_global_action(self, "Quit forcefully", 'Q', |siv| siv.quit()); context.add_global_action(self, "Back", Key::Backspace, |siv| siv.pop_ui(false));