Skip to main content

try_restore

Function try_restore 

Source
pub fn try_restore(terminal: &mut DefaultTerminal) -> Result<()>
Expand description

Restore a terminal built by the setup helpers.

This calls UncursesBackend::restore on the terminal’s backend. The backend delegates to the wrapped screen’s teardown path, which resets staged modes, restores cursor and screen state, flushes pending output, and leaves raw mode.

§Parameters

§Returns

Ok(()) once teardown has completed.

§Errors

Returns any error from screen teardown, flushing, or restoring the terminal mode.

§Panics

Does not intentionally panic.

§Usage note

Treat this as the single teardown entry point for terminals initialized by this module; do not independently undo individual modes first.