pub fn restore_terminal_on_panic<T>(f: impl FnOnce() -> T) -> TExpand description
Runs a closure that sets up its own raw-mode alternate screen, restoring the terminal before a panic message is displayed.
Release builds abort on panic, so the closure’s own cleanup on drop never runs.