ratatui

Function restore

Source
pub fn restore()
Expand description

Restores the terminal to its original state.

This function should be called before the program exits to ensure that the terminal is restored to its original state.

This function will attempt to restore the terminal to its original state by performing the following steps:

  1. Raw mode is disabled.
  2. The alternate screen buffer is left.

If either of these steps fail, the error is printed to stderr and ignored.

Use this function over try_restore 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 try_restore instead.

§Examples

ratatui::restore();