aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/application.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/src/application.rs')
-rw-r--r--helix-term/src/application.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs
index e75b0ecb..9622ad91 100644
--- a/helix-term/src/application.rs
+++ b/helix-term/src/application.rs
@@ -447,17 +447,20 @@ impl Application {
// Exit the alternate screen and disable raw mode before panicking
let hook = std::panic::take_hook();
std::panic::set_hook(Box::new(move |info| {
- execute!(std::io::stdout(), terminal::LeaveAlternateScreen);
- terminal::disable_raw_mode();
+ // We can't handle errors properly inside this closure. And it's
+ // probably not a good idea to `unwrap()` inside a panic handler.
+ // So we just ignore the `Result`s.
+ let _ = execute!(std::io::stdout(), terminal::LeaveAlternateScreen);
+ let _ = terminal::disable_raw_mode();
hook(info);
}));
self.event_loop().await;
- self.editor.close_language_servers(None).await;
+ self.editor.close_language_servers(None).await?;
// reset cursor shape
- write!(stdout, "\x1B[2 q");
+ write!(stdout, "\x1B[2 q")?;
execute!(stdout, terminal::LeaveAlternateScreen)?;