Deleting fish shell history
Have you ever made a typo? No, me neither, but in case you ever do...
I run a lot of commands via the shell history using fzf and CTRL-R to save re-typing, and ironically, mispellings. However, if you do mispell something it ends up in the history forevermore, taunting you upon each invocation of fzf-history-widget.
It turns out that fish ships with a neat
history command that allows you
to manipulate the history is various ways including searching, deleting, and
The command I want to remove in this case is
mix echo (which should be
I use the
--contains option here which will present a prompt showing the
entries and allowing you to delete individual entries or remove all.
1 2 3 4 5 6 7 8 9 10 11 12 $ history delete --contains "mix echo"  history search --contains "mix echo"  mix echo.migrate  mix echo.create  mix echo.reset  mix echo.setup Enter nothing to cancel the delete, or Enter one or more of the entry IDs separated by a space, or Enter "all" to delete all the matching entries. [I] Delete which entries? >
If you want to search before running
delete you can do
--contains "<search>" which will return a list of items for you to check.