Even with close confirmation I sometimes close my terminal and think "OH FUCK NO." Coming soon to Ghostty, you can undo that. π₯° (Technical details: we keep the terminal running for a configurable time in the background before terminating for real, similar to email undo send).
(macOS only for now, AppKit APIs provide a nice undo manager implementation that eases this quite a bit. I still have to do research on GTK for Linux.)