New features in the fish shell
New features in the fish shell
Posted Oct 3, 2020 6:44 UTC (Sat) by marcH (subscriber, #57642)In reply to: New features in the fish shell by szm
Parent article: New features in the fish shell
Agreed 200%: I recalled by mistake commands like these from my (crazy long) bash history once or twice and now I'm trying hard to never let them get there in the first place.
Another trick I use (better safe twice than sorry) is this:
rm -rf ../current_directory/*
With completion it takes barely longer to type and it greatly reduces the chances of that command doing anything if recalled by accident.
Finally, there is of course:
mv * ~/Trash/
Only the last one would probably have stopped me from recursively deleting the target of a symbolic link while thinking I was just deleting the link itself...
Posted Oct 3, 2020 17:51 UTC (Sat)
by jo42 (subscriber, #59640)
[Link]
zshaddhistory()
New features in the fish shell
{
# Don't save run-help and kill commands and commands run in bad-stuff
[[ $1 != (run-help *|kill *|bg|fg|cd|reboot|halt) && $PWD != $HOME/bad-stuff/* ]]
}
