aboutsummaryrefslogtreecommitdiff
path: root/helix-term
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-10-19 15:00:28 +0000
committerBlaž Hrastnik2021-10-19 15:01:11 +0000
commite9b23c29d8e8bca1d4140d02350bdae824a651b0 (patch)
tree9aae81b231a00f84ea4b6e7d4718fb0f5426384f /helix-term
parent9688cb74a1e931edfa625cd28a828e728fcea675 (diff)
Ignore errors when disabling mouse capture
Diffstat (limited to 'helix-term')
-rw-r--r--helix-term/src/application.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs
index a7281ecf..82ad04d7 100644
--- a/helix-term/src/application.rs
+++ b/helix-term/src/application.rs
@@ -563,7 +563,9 @@ impl Application {
let mut stdout = stdout();
// reset cursor shape
write!(stdout, "\x1B[2 q")?;
- execute!(stdout, DisableMouseCapture)?;
+ // Ignore errors on disabling, this might trigger on windows if we call
+ // disable without calling enable previously
+ let _ = execute!(stdout, DisableMouseCapture);
execute!(stdout, terminal::LeaveAlternateScreen)?;
terminal::disable_raw_mode()?;
Ok(())