mirror of
https://github.com/herdrdev/herdr.git
synced 2026-09-22 00:01:06 +00:00
38 lines
1.0 KiB
Rust
38 lines
1.0 KiB
Rust
#[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
|
|
}
|
|
}
|
|
|
|
#[derive(Debug)]
|
|
pub(crate) struct ImportedHandoffRuntime {
|
|
#[cfg(unix)]
|
|
pub master_fd: std::os::fd::RawFd,
|
|
#[cfg(unix)]
|
|
pub state: HandoffRuntimeState,
|
|
}
|