Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FAQ for terminal getting messed up on panic #551

Open
joshka opened this issue Apr 7, 2024 · 2 comments
Open

Add FAQ for terminal getting messed up on panic #551

joshka opened this issue Apr 7, 2024 · 2 comments
Labels
good first issue Good for newcomers

Comments

@joshka
Copy link
Member

joshka commented Apr 7, 2024

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

This should mostly point at resources to fix this

@kdheepak kdheepak added the good first issue Good for newcomers label Apr 7, 2024
@evbo
Copy link

evbo commented Nov 20, 2024

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
Copy link

evbo commented Nov 20, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants