From a5c69beabfc82d9c3f9563eb821139b2e0f3e14f Mon Sep 17 00:00:00 2001 From: Can Celik Date: Wed, 19 Aug 2026 04:43:28 +0300 Subject: fix(perf): eliminate redundant terminal wake work (#2962) * fix(perf): eliminate redundant terminal wake work * fix(perf): harden release benchmark gate * test(perf): strengthen performance guardrails --- src/input/mod.rs | 6 ++++-- src/input/model.rs | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'src/input') diff --git a/src/input/mod.rs b/src/input/mod.rs index 21893303..8108bf99 100644 --- a/src/input/mod.rs +++ b/src/input/mod.rs @@ -9,8 +9,10 @@ pub use encode::{ }; #[cfg(not(windows))] pub use model::ime_compatible_keyboard_enhancement_flags; +#[cfg(any(unix, test))] +pub use model::MouseProtocolMode; pub use model::{ - host_modify_other_keys_mode, KeyIdentity, KeyboardProtocol, MouseProtocolEncoding, - MouseProtocolMode, TerminalKey, TextCommit, WindowsKeyRecord, + host_modify_other_keys_mode, KeyIdentity, KeyboardProtocol, MouseProtocolEncoding, TerminalKey, + TextCommit, WindowsKeyRecord, }; pub use parse::parse_terminal_key_sequence; diff --git a/src/input/model.rs b/src/input/model.rs index 21252d2d..cada5506 100644 --- a/src/input/model.rs +++ b/src/input/model.rs @@ -295,6 +295,7 @@ impl KeyboardProtocol { } } +#[cfg(any(unix, test))] #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub enum MouseProtocolMode { @@ -305,7 +306,9 @@ pub enum MouseProtocolMode { AnyMotion, } +#[cfg(any(unix, test))] impl MouseProtocolMode { + #[cfg(test)] pub fn reporting_enabled(self) -> bool { self != Self::None } -- cgit v1.2.3