diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-06-18 02:52:35 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-06-18 02:53:31 +0300 |
| commit | 36b4001f4526b60f1c9b67a4a34596e5ad2bcca1 (patch) | |
| tree | 520ab28a0a3f3f798e6e655fc83529e8617720e9 /src/client/input.rs | |
| parent | aca35ea76f3df15ec68fd07959d939f5e7a78a6c (diff) | |
feat: sync theme with host appearance
refs #675
Diffstat (limited to 'src/client/input.rs')
| -rw-r--r-- | src/client/input.rs | 17 |
1 files changed, 16 insertions, 1 deletions
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, } } |
