summaryrefslogtreecommitdiff
path: root/src/protocol
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-06-30 02:47:50 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-06-30 02:48:02 +0300
commit0fa6440d41c31f23ba2126e4b23bc5627705e317 (patch)
treead2fefbd69efdac78bc7b2a0c3c36f712a13d116 /src/protocol
parentf3da280ccc7beac0c1491578cd32e04495ae08bf (diff)
feat: add terminal session control stream
Diffstat (limited to 'src/protocol')
-rw-r--r--src/protocol/wire.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/protocol/wire.rs b/src/protocol/wire.rs
index e6ba5746..5f44691b 100644
--- a/src/protocol/wire.rs
+++ b/src/protocol/wire.rs
@@ -387,6 +387,14 @@ pub enum ClientMessage {
/// Pane, terminal, or agent target to observe.
target: String,
},
+
+ /// Switch this connection into writable terminal control mode.
+ ControlTerminal {
+ /// Pane, terminal, or agent target to control.
+ target: String,
+ /// Replace an existing writable controller for this terminal.
+ takeover: bool,
+ },
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
@@ -1005,6 +1013,13 @@ mod tests {
}),
8
);
+ assert_eq!(
+ tag(&ClientMessage::ControlTerminal {
+ target: "w1:p1".to_owned(),
+ takeover: false,
+ }),
+ 9
+ );
}
#[test]
@@ -1144,6 +1159,18 @@ mod tests {
}
#[test]
+ fn client_control_terminal_roundtrip() {
+ let msg = ClientMessage::ControlTerminal {
+ target: "w1:p1".to_owned(),
+ takeover: true,
+ };
+ let encoded = bincode::serde::encode_to_vec(&msg, bincode::config::standard()).unwrap();
+ let (decoded, _): (ClientMessage, _) =
+ bincode::serde::decode_from_slice(&encoded, bincode::config::standard()).unwrap();
+ assert_eq!(msg, decoded);
+ }
+
+ #[test]
fn client_attach_scroll_roundtrip() {
let msg = ClientMessage::AttachScroll {
source: AttachScrollSource::Wheel,