Ignore errors when disabling mouse capture

This commit is contained in:
Blaž Hrastnik 2021-10-20 00:00:28 +09:00
parent 9688cb74a1
commit e9b23c29d8

View File

@ -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(())