From 62431dbd033bf1be2fe87fbc526df28084214e49 Mon Sep 17 00:00:00 2001 From: Can Celik Date: Tue, 8 Sep 2026 00:35:48 +0300 Subject: fix: reduce idle ssh cpu without dropping final output (#3728) * fix: stop polling idle ssh uploads on unix * fix: preserve ssh output during idle bridge cancellation * test: exercise active ssh upload cancellation --- src/platform/windows.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/platform/windows.rs') diff --git a/src/platform/windows.rs b/src/platform/windows.rs index 4deb1864..e58bacae 100644 --- a/src/platform/windows.rs +++ b/src/platform/windows.rs @@ -24,6 +24,25 @@ pub(crate) fn classify_child_exit(status: &portable_pty::ExitStatus) -> super::C } } +pub(crate) struct RemoteBridgeWake; + +impl RemoteBridgeWake { + pub(crate) fn new() -> std::io::Result { + Ok(Self) + } + + pub(crate) fn cancel(&self) -> std::io::Result<()> { + // The named-pipe reader checks its cancellation flag between peeks. + Ok(()) + } + + pub(crate) fn wait(&self, _stream: &crate::ipc::LocalStream) -> std::io::Result<()> { + // Synchronous named pipes still use peek-before-read polling on Windows. + std::thread::sleep(Duration::from_millis(1)); + Ok(()) + } +} + pub(crate) fn wait_client_stream_readable( _stream: &crate::ipc::LocalStream, ) -> std::io::Result<()> { -- cgit v1.2.3