From 99c23cd1ea7468bd3661f6483c7105396503b417 Mon Sep 17 00:00:00 2001 From: JJ Liebig Date: Tue, 1 Sep 2026 23:46:16 +0400 Subject: fix(windows): preserve native pane key identity (#3503) --- src/input/mod.rs | 1 - src/input/model.rs | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/input') diff --git a/src/input/mod.rs b/src/input/mod.rs index 0cd6c4bd..13b8ffa3 100644 --- a/src/input/mod.rs +++ b/src/input/mod.rs @@ -23,7 +23,6 @@ pub(crate) use lease::{InputLeaseKey, InputLeaseTable, RepeatPlan}; pub use model::ime_compatible_keyboard_enhancement_flags; #[cfg(any(unix, test))] pub use model::MouseProtocolMode; -#[cfg(any(windows, test))] pub use model::WindowsKeyRecord; pub use model::{ host_modify_other_keys_mode, KeyIdentity, KeyboardProtocol, MouseProtocolEncoding, TerminalKey, diff --git a/src/input/model.rs b/src/input/model.rs index e45ef378..304c4f20 100644 --- a/src/input/model.rs +++ b/src/input/model.rs @@ -3,7 +3,6 @@ use crossterm::event::KeyboardEnhancementFlags; use crossterm::event::{KeyCode, KeyEvent, KeyModifiers}; use serde::{Deserialize, Serialize}; -#[cfg(any(windows, test))] #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] pub struct WindowsKeyRecord { pub key_down: bool, @@ -167,12 +166,14 @@ impl TerminalKey { } } - #[cfg(any(windows, test))] pub(crate) fn windows_record(&self) -> Option { + #[cfg(any(windows, test))] match self.source { KeySource::WindowsConsole { record, .. } => Some(record), KeySource::Synthesized | KeySource::Vt { .. } => None, } + #[cfg(not(any(windows, test)))] + None } pub(crate) fn identity(&self) -> KeyIdentity { -- cgit v1.2.3