From 36b4001f4526b60f1c9b67a4a34596e5ad2bcca1 Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Thu, 18 Jun 2026 02:52:35 +0300 Subject: feat: sync theme with host appearance refs #675 --- src/client/input.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/client/input.rs') diff --git a/src/client/input.rs b/src/client/input.rs index add4990c..ba1e353f 100644 --- a/src/client/input.rs +++ b/src/client/input.rs @@ -59,6 +59,7 @@ fn unix_stdin_reader_loop( let mut framer = crate::raw_input::RawInputByteFramer::default(); if host_color_query_sent { framer.host_color_query_sent(); + framer.enable_host_color_scheme_change_tracking(); } while !should_quit.load(Ordering::Acquire) { @@ -75,7 +76,10 @@ fn unix_stdin_reader_loop( } if stdin_read_ready(&reader, 10) == Some(false) { - for data in framer.flush_timeout() { + let had_pending = framer.has_pending_input(); + let chunks = framer.flush_timeout(); + let held_escape = had_pending && chunks.is_empty(); + for data in chunks { if event_tx .blocking_send(ClientLoopEvent::StdinInput(data)) .is_err() @@ -83,6 +87,16 @@ fn unix_stdin_reader_loop( return; } } + if held_escape && stdin_read_ready(&reader, 10) == Some(false) { + for data in framer.flush_timeout() { + if event_tx + .blocking_send(ClientLoopEvent::StdinInput(data)) + .is_err() + { + return; + } + } + } } } Err(err) => { @@ -268,6 +282,7 @@ fn windows_client_input_event_from_raw( Some(crate::protocol::ClientInputEvent::FocusLost) } crate::raw_input::RawInputEvent::HostDefaultColor { .. } + | crate::raw_input::RawInputEvent::HostColorSchemeChanged(_) | crate::raw_input::RawInputEvent::Unsupported => None, } } -- cgit v1.2.3