iTerm takes this approach with closing panes, and it’s an absolute life saver. When you close a terminal, it keeps the shell process running until you take some other action, or some timer runs out, and can fully restore it if you cmd-Z.
I really wish browsers would do the same with closing browser tabs.
Edit: To clarify, I mean that I wish browsers would actually keep the tab process running for a short while so that the entire state can be restored. I’m aware of “reopen tab”, but that doesn’t help you in most cases if you have a paragraph typed into a web app and accidentally close it.