Skip to main content

restore_terminal_on_panic

Function restore_terminal_on_panic 

Source
pub fn restore_terminal_on_panic<T>(f: impl FnOnce() -> T) -> T
Expand 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.