I still maintain this is why macOS is the best OS for terminal work -- all the common keybindings for GUI tools use a different modifier key, so e.g. ⌘C and ⌘W work the same in your terminal as they do in your browser.
(Lots of the readline/emacs-style editing keybindings work everywhere in macos as well -- ^A, ^E, ^K, ^Y, but not ^U for some reason)
1. Load about:keyboard
2. Find "Close tab" and click "Clear" or "Change".
Yeah, pressing Ctrl-W accidentially is a pain sometimes ... but Ctrl-Shift-T in Firefox is a godsend.
Fun fact: despite having absolutely no menu entry for it, and I believe not even a command available with Ctrl+Shift+P, Vscode supports Ctrl+Shift+T to re-open a closed tab. Discovered out of pure muscle memory.
stty werase undef
bind '"\C-w": backward-kill-word'
source: https://superuser.com/questions/212446/binding-backward-kill...You're telling me!!!
(I use vim daily, with multiple splits in a single instance.)
Or maybe you don’t use SHIFT. Can’t recall right now. My fingers know but I’m not at a computer.
Anyway, browser menus can also show you recently closed tabs and bring them back.
This hurts.
Also, for the shell, if you do C+w, you can "paste" it back using C+y. Assuming you have not removed that configuration.
That, and Ctrl-N. No more forest of blank browser windows when using a terminal emulator in a web page!
(Firefox only)
Ctrl+Shift+T will undo your recent tab closures in reverse order. The tabs maintain their history as well.
I am very surprised at how many people in here don’t seem to know that. I learned about Ctrl+Shift+T before I learned about Ctrl+W. I was using the middle mouse button on a tab to close tabs before then.