diff options
| author | Helmut K. C. Tessarek <tessarek@evermeet.cx> | 2025-02-19 06:01:03 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-18 21:01:03 -0800 |
| commit | c55ea10a4b2ac70467024bd6e4b06da2e57c9dfe (patch) | |
| tree | a56d77aa0f6c63f631e111f3ca69c02a414e0c91 | |
| parent | fix: add .histfile as file to look for when doing atuin import zsh (#2588) (diff) | |
| download | atuin-c55ea10a4b2ac70467024bd6e4b06da2e57c9dfe.zip | |
fix: panic when invoking delete on empty tui (#2584)
If the result set is empty and thus the TUI does not show any entries,
a panic occurs when a user invokes 'delete' via Prefix Ctrl-D or Ctrl-D
in the inspector..
| -rw-r--r-- | crates/atuin/src/command/client/search/interactive.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/atuin/src/command/client/search/interactive.rs b/crates/atuin/src/command/client/search/interactive.rs index c1a678f0..d7c9d5eb 100644 --- a/crates/atuin/src/command/client/search/interactive.rs +++ b/crates/atuin/src/command/client/search/interactive.rs @@ -1116,6 +1116,9 @@ pub async fn history( match app.handle_input(settings, &event::read()?, &mut std::io::stdout())? { InputAction::Continue => {}, InputAction::Delete(index) => { + if results.is_empty() { + break; + } app.results_len -= 1; let selected = app.results_state.selected(); if selected == app.results_len { |
