diff options
Diffstat (limited to 'src/protocol')
| -rw-r--r-- | src/protocol/wire.rs | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/protocol/wire.rs b/src/protocol/wire.rs index 8225cb8c..e31f8ff5 100644 --- a/src/protocol/wire.rs +++ b/src/protocol/wire.rs @@ -13,7 +13,7 @@ use serde::{Deserialize, Serialize}; // --------------------------------------------------------------------------- /// Current protocol version. Bumped when wire format changes incompatibly. -pub const PROTOCOL_VERSION: u32 = 15; +pub const PROTOCOL_VERSION: u32 = 16; /// Maximum allowed frame payload size (2 MB). Frames larger than this are /// rejected to prevent denial-of-service via oversized length prefixes. @@ -656,6 +656,14 @@ pub enum ServerMessage { /// True when Herdr mouse UI is enabled or the focused pane app requests mouse reporting. enabled: bool, }, + + /// Apply the prefix-mode ASCII input-source change on the foreground client. + /// `active = true` → switch to an ASCII-capable source (saving the current one); + /// `active = false` → restore the saved source. + PrefixInputSource { + /// Whether the ASCII input source should be active. + active: bool, + }, } // --------------------------------------------------------------------------- @@ -1404,6 +1412,17 @@ mod tests { assert_eq!(msg, decoded); } + #[test] + fn server_prefix_input_source_roundtrip() { + for active in [true, false] { + let msg = ServerMessage::PrefixInputSource { active }; + let encoded = bincode::serde::encode_to_vec(&msg, bincode::config::standard()).unwrap(); + let (decoded, _): (ServerMessage, _) = + bincode::serde::decode_from_slice(&encoded, bincode::config::standard()).unwrap(); + assert_eq!(msg, decoded); + } + } + // ---- Framing ---- #[test] |
