diff --git a/atuin/src/command/client/search/interactive.rs b/atuin/src/command/client/search/interactive.rs index 5076d52..eec7ac8 100644 --- a/atuin/src/command/client/search/interactive.rs +++ b/atuin/src/command/client/search/interactive.rs @@ -105,7 +105,7 @@ impl State { // reset the state, will be set to true later if user really did change it self.switched_search_mode = false; match input.code { - KeyCode::Char('c' | 'd' | 'g') if ctrl => return Some(RETURN_ORIGINAL), + KeyCode::Char('c' | 'g') if ctrl => return Some(RETURN_ORIGINAL), KeyCode::Esc => { return Some(match settings.exit_mode { ExitMode::ReturnOriginal => RETURN_ORIGINAL, @@ -165,6 +165,12 @@ impl State { KeyCode::Delete => { self.search.input.remove(); } + KeyCode::Char('d') if ctrl => { + if self.search.input.as_str().is_empty() { + return Some(RETURN_ORIGINAL); + } + self.search.input.remove(); + } KeyCode::Char('w') if ctrl => { // remove the first batch of whitespace while matches!(self.search.input.back(), Some(c) if c.is_whitespace()) {}