Skip to content

Commit d404b71

Browse files
fix: restore terminal before joining downloader (#8)
1 parent 797e77b commit d404b71

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎src/main.rs‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,11 +433,12 @@ fn run_tui(args: &Args) -> Result<(), String> {
433433
if let Some(cancel) = download_cancel.take() {
434434
cancel.store(true, std::sync::atomic::Ordering::Relaxed);
435435
}
436+
// restore the terminal before joining a downloader that may be waiting on
437+
// a network read timeout after cancellation.
438+
guard.restore();
436439
if let Some(h) = downloader.take() {
437440
let _ = h.join();
438441
}
439-
// restore the terminal before waiting on a possibly slow worker window.
440-
guard.restore();
441442
if let Some(h) = handle.take() {
442443
h.stop();
443444
}

0 commit comments

Comments
 (0)