fix: restore the cursor shape when exiting the app

This commit is contained in:
Dreck Sallow 2024-10-31 23:57:32 -05:00
parent 38faf74feb
commit 655e3d3cbb

View File

@ -1202,7 +1202,11 @@ fn restore_term(&mut self) -> std::io::Result<()> {
.backend_mut() .backend_mut()
.show_cursor(CursorKind::Block) .show_cursor(CursorKind::Block)
.ok(); .ok();
self.terminal.restore(terminal_config)
use std::io::Write;
self.terminal.restore(terminal_config)?;
write!(std::io::stdout(), "\x1B[0 q") // reset to cursor shape
} }
pub async fn run<S>(&mut self, input_stream: &mut S) -> Result<i32, Error> pub async fn run<S>(&mut self, input_stream: &mut S) -> Result<i32, Error>