From e9b23c29d8e8bca1d4140d02350bdae824a651b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Wed, 20 Oct 2021 00:00:28 +0900 Subject: [PATCH] Ignore errors when disabling mouse capture --- helix-term/src/application.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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(())