From 374df9d69f595a9923353cb95dd0a50dccfe5967 Mon Sep 17 00:00:00 2001 From: Stefan Holderbach Date: Sun, 11 Jun 2023 00:15:46 +0200 Subject: [PATCH] Enable history entry exclusion with leading space (#9371) # Description Makes use of the feature introduced by nushell/reedline#566 If we consider this to be problematic we can decide to add a config point for this behavior, but at first I was a bit hesistant expanding the config in this area. # User-Facing Changes Follows precedent found in bash/zsh/fish to exclude lines starting with a space from the history. Like in fish you can still recall the last entry once but it will not be stored and will be forgotten after the next submitted entry. # Tests + Formatting (-) --- crates/nu-cli/src/repl.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/nu-cli/src/repl.rs b/crates/nu-cli/src/repl.rs index 5d1a48af22..4a816557b9 100644 --- a/crates/nu-cli/src/repl.rs +++ b/crates/nu-cli/src/repl.rs @@ -141,6 +141,7 @@ pub fn evaluate_repl( }; line_editor = line_editor .with_history_session_id(history_session_id) + .with_history_exclusion_prefix(Some(" ".into())) .with_history(history); }; perf(