restore terminal snapshot on panic
@@ -641,7 +641,11 @@ pub fn start(mut os_input: Box<dyn OsApi>, opts: CliArgs) {
let _ = wasm_thread.join();
os_input.unset_raw_mode(0);
let goto_start_of_last_line = format!("\u{1b}[{};{}H", full_screen_ws.rows, 1);
- let error = format!("{}\n{}", goto_start_of_last_line, backtrace);
+ let restore_snapshot = "\u{1b}[?1049l";
+ let error = format!(
+ "{}\n{}{}",
+ goto_start_of_last_line, restore_snapshot, backtrace
+ );
let _ = os_input
.get_stdout_writer()
.write(error.as_bytes())
