diff --git a/src/ui/inputwin.c b/src/ui/inputwin.c index b3629861..6e98af02 100644 --- a/src/ui/inputwin.c +++ b/src/ui/inputwin.c @@ -182,7 +182,13 @@ inp_readline(void) { // UI is suspended if (is_suspended || isendwin()) { + // Mirror the normal-path unlock/sleep/lock so worker threads + // (http_upload / http_download / ai_client) can acquire `lock` + // during the editor session — otherwise the main thread holds + // it continuously and every in-flight transfer freezes. + pthread_mutex_unlock(&lock); g_usleep(100000); // 100ms + pthread_mutex_lock(&lock); return NULL; }