ratatui-website icon indicating copy to clipboard operation
ratatui-website copied to clipboard

Add FAQ for terminal getting messed up on panic

Open joshka opened this issue 2 years ago • 2 comments

See https://discord.com/channels/1070692720437383208/1072907135664529508/1226403628202332255 for details

This should mostly point at resources to fix this

joshka avatar Apr 07 '24 07:04 joshka

For the next person wondering, this has since been implemented in the default init:

let mut terminal = ratatui::init();

Per doc string:

/// This will create a new [DefaultTerminal] and initialize it with the following defaults: /// /// - Backend: [CrosstermBackend] writing to [Stdout] /// - Raw mode is enabled /// - Alternate screen buffer enabled /// - A panic hook is installed that restores the terminal before panicking. Ensure that this method /// is called after any other panic hooks that may be installed to ensure that the terminal is /// restored before those hooks are called.

evbo avatar Nov 20 '24 18:11 evbo

so these docs should probably get updated to: https://ratatui.rs/recipes/apps/panic-hooks/

evbo avatar Nov 20 '24 18:11 evbo