mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 13:39:02 +00:00
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:
parent
cda415cb5d
commit
3663726689
1 changed files with 6 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue