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
This commit is contained in:
Kurtis Rader 2016-10-11 18:59:45 -07:00
parent cda415cb5d
commit 3663726689

View file

@ -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