So it already happened to me once, I was trying to run
rm -r ~/.emacs.d
But accidentally hit enter at just the wrong moment.
rm -r ~
Luckily I run into protected files before deleting everything, and was running it in a fairly new Termux enviornment instead of my main computer. However, on that main computer I was just trying to run
rm -r ~/.go ~
(I originally tried rm -r ~/.go ~/.config/go but then saw with highlighting that the latter isn't a thing, obviously, and accidentally hit enter instead of backspace, at just the worst moment).
Again, I was spared by protected files and thank god the fact ~/.go was first.
At any case, I would really like to avoid such danger; my thought is that maybe I could use some magic option with an alias or define my own rm() function so ~ will act similarly to /. Alternatively unix magic is also fine.
Of course, the obvious solution is to just get into the habit of always cd ~ first and remove with relative paths, but I would like a quicker solution so I won't die of a heart attack while trying to form it.