Skip to content

Commit 494df27

Browse files
author
mxve
committed
restore console cursor on exit
1 parent 7f04519 commit 494df27

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/main.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ fn setup_terminal() -> Result<(), Box<dyn std::error::Error>> {
153153
Ok(())
154154
}
155155

156+
fn cleanup_terminal() {
157+
let mut stdout = io::stdout();
158+
let _ = execute!(stdout, cursor::Show);
159+
}
160+
156161
async fn run_launcher() -> Result<(), Box<dyn std::error::Error>> {
157162
let args = Args::parse();
158163

@@ -347,8 +352,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
347352
let result = run_launcher().await;
348353
if let Err(e) = &result {
349354
println_error!("{}", e);
355+
cleanup_terminal();
350356
misc::enter_exit(1);
351357
}
352358

359+
cleanup_terminal();
353360
result
354361
}

0 commit comments

Comments
 (0)