diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-28 04:11:56 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-28 04:12:53 +0300 |
| commit | bf9cc201244946496b4d950046bf7edcc4892994 (patch) | |
| tree | 920c866e67783cf31d2feff9642457204999c8eb /src/handoff_runtime.rs | |
| parent | 789738cada5afaa20bbd77a0d479fb689c455bfe (diff) | |
fix: preserve live handoff terminal state
Diffstat (limited to 'src/handoff_runtime.rs')
| -rw-r--r-- | src/handoff_runtime.rs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/handoff_runtime.rs b/src/handoff_runtime.rs new file mode 100644 index 00000000..331cff07 --- /dev/null +++ b/src/handoff_runtime.rs @@ -0,0 +1,36 @@ +#[cfg(unix)] +use serde::{Deserialize, Serialize}; + +#[cfg(unix)] +#[derive(Debug, Clone, Serialize, Deserialize)] +pub(crate) struct HandoffRuntimeState { + pub pane_id: u32, + pub child_pid: u32, + pub rows: u16, + pub cols: u16, + pub cell_width_px: u32, + pub cell_height_px: u32, + #[serde(default)] + pub keyboard_protocol_flags: u16, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub keyboard_protocol_ansi: Option<String>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub input_state: Option<crate::pane::InputState>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub initial_history_ansi: Option<String>, +} + +#[cfg(unix)] +impl HandoffRuntimeState { + pub fn with_pane_id(mut self, pane_id: crate::layout::PaneId) -> Self { + self.pane_id = pane_id.raw(); + self + } +} + +#[cfg(unix)] +#[derive(Debug)] +pub(crate) struct ImportedHandoffRuntime { + pub master_fd: std::os::fd::RawFd, + pub state: HandoffRuntimeState, +} |
