Disable crossterm raw mode

Without this change, the output of panic messages by miette would ignore
newlines and become unreadable.
This commit is contained in:
Jakub Žádník
2021-10-01 19:39:50 +03:00
parent 5a5205d5d9
commit a16144baf1
3 changed files with 7 additions and 0 deletions

View File

@ -17,6 +17,11 @@ mod tests;
fn main() -> Result<()> {
miette::set_panic_hook();
let miette_hook = std::panic::take_hook();
std::panic::set_hook(Box::new(move |x| {
crossterm::terminal::disable_raw_mode().unwrap();
miette_hook(x);
}));
let engine_state = create_default_context();