pub fn try_restore() -> Result<()>
Available on crate feature
crossterm
only.Expand description
Restore the terminal to its original state.
This function will attempt to restore the terminal to its original state by performing the following steps:
- Raw mode is disabled.
- The alternate screen buffer is left.
If either of these steps fail, the error is returned.
Use restore
instead of this function when you don’t need to handle the error yourself, as
ignoring the error is generally the correct behavior when cleaning up before exiting. If you
need to handle the error yourself, use this function instead.
§Examples
ratatui::try_restore()?;