From 3663726689427c71fd66de66ce587b70bee60798 Mon Sep 17 00:00:00 2001 From: Kurtis Rader Date: Tue, 11 Oct 2016 18:59:45 -0700 Subject: [PATCH] fix interactive deletion of "all" items While working on making the history command support case-sensitive and insensitive searches I noticed that entering "all" when interactively deleting history entries resulted in an error. That's because the history builtin currently only supports `--exact` so we need to loop over the matching entries and delete them one at a time. Fixes #3448 --- share/functions/history.fish | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/share/functions/history.fish b/share/functions/history.fish index 286e0dd8e..569fd6ef2 100644 --- a/share/functions/history.fish +++ b/share/functions/history.fish @@ -169,7 +169,12 @@ function history --description "display or manipulate interactive command histor if test "$choice" = "all" printf "Deleting all matching entries!\n" - builtin history delete $search_mode -- $argv + # TODO: Use the following when the builtin is enhanced to support the + # --prefix and --contains options (at the moment it only supports --exact). + # builtin history delete $search_mode -- $argv + for item in $found_items + builtin history delete --exact -- $item + end builtin history save return end