From 70dc7e9b0ce0ae3723998d058744b71e76b44614 Mon Sep 17 00:00:00 2001 From: soumalya das Date: Sat, 28 Nov 2026 09:19:45 +0530 Subject: [PATCH] fix: restore terminal before joining downloader --- src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 852b990..5951111 100644 --- a/src/main.rs +++ b/src/main.rs @@ -433,11 +433,12 @@ fn run_tui(args: &Args) -> Result<(), String> { if let Some(cancel) = download_cancel.take() { cancel.store(true, std::sync::atomic::Ordering::Relaxed); } + // restore the terminal before joining a downloader that may be waiting on + // a network read timeout after cancellation. + guard.restore(); if let Some(h) = downloader.take() { let _ = h.join(); } - // restore the terminal before waiting on a possibly slow worker window. - guard.restore(); if let Some(h) = handle.take() { h.stop(); }