From 42ea744901aedd7c57991b29e1e05e425563b2c0 Mon Sep 17 00:00:00 2001 From: sxyazi Date: Fri, 19 Jun 2026 09:27:05 +0800 Subject: [PATCH] Fix Windows --- yazi-term/src/source/windows.rs | 2 +- yazi-term/src/stream/stream.rs | 1 + yazi-tui/src/raterm.rs | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/yazi-term/src/source/windows.rs b/yazi-term/src/source/windows.rs index a0cc3bde..072546a5 100644 --- a/yazi-term/src/source/windows.rs +++ b/yazi-term/src/source/windows.rs @@ -28,7 +28,7 @@ impl<'a> EventSource<'a> { // More input is ready. WAIT_OBJECT_0 => Ok(()), // Stop waiting for events. - r if r == WAIT_OBJECT_0 + 1 => Err(io::Error::from(io::ErrorKind::UnexpectedEof)), + r if r == WAIT_OBJECT_0 + 1 => Err(io::Error::from(io::ErrorKind::ConnectionAborted)), // Timeout expired. WAIT_TIMEOUT => Err(io::Error::from(io::ErrorKind::TimedOut)), // An error occurred. diff --git a/yazi-term/src/stream/stream.rs b/yazi-term/src/stream/stream.rs index adf21d2d..ad83a29e 100644 --- a/yazi-term/src/stream/stream.rs +++ b/yazi-term/src/stream/stream.rs @@ -33,6 +33,7 @@ impl EventStream { } // try_poll() already handles Interrupted, this is defensive. Err(e) if e.kind() == io::ErrorKind::Interrupted => continue, + // event source was gracefully stopped, stop the stream as well. Err(e) if e.kind() == io::ErrorKind::ConnectionAborted => break, Err(e) => { tx.send(Err(e)).ok(); diff --git a/yazi-tui/src/raterm.rs b/yazi-tui/src/raterm.rs index dcdd97b9..24b8a259 100644 --- a/yazi-tui/src/raterm.rs +++ b/yazi-tui/src/raterm.rs @@ -109,7 +109,7 @@ impl Raterm { Some(Err(_)) => { AppProxy::quit(Default::default()); break; - }, + } None => break, } }