aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--atuin/src/command/client/search/interactive.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/atuin/src/command/client/search/interactive.rs b/atuin/src/command/client/search/interactive.rs
index f74be643..a1247964 100644
--- a/atuin/src/command/client/search/interactive.rs
+++ b/atuin/src/command/client/search/interactive.rs
@@ -379,6 +379,21 @@ impl State {
KeyCode::Backspace => {
self.search.input.back();
}
+ KeyCode::Char('h' | '?') if ctrl => {
+ // Depending on the terminal, [Backspace] can be transmitted as
+ // \x08 or \x7F. Also, [Ctrl+Backspace] can be transmitted as
+ // \x08 or \x7F or \x1F. On the other hand, [Ctrl+h] and
+ // [Ctrl+?] are also transmitted as \x08 or \x7F by the
+ // terminals.
+ //
+ // The crossterm library translates \x08 and \x7F to C-h and
+ // Backspace, respectively. With the extended keyboard
+ // protocol enabled, crossterm can faithfully translate
+ // [Ctrl+h] and [Ctrl+?] to C-h and C-?. There is no perfect
+ // solution, but we treat C-h and C-? the same as backspace to
+ // suppress quirks as much as possible.
+ self.search.input.back();
+ }
KeyCode::Delete if ctrl => self
.search
.input