pub struct Window { /* private fields */ }Expand description
A session-owned window whose pane order is independent from pane indices.
Pane order is preserved separately from pane indices so a split can insert a new pane immediately after its split target while still assigning the next sequential pane index. Stable pane IDs remain independent from those window-local display indices, which may contain gaps after deletion.
Implementations§
Source§impl Window
impl Window
Sourcepub fn new(size: TerminalSize) -> Self
pub fn new(size: TerminalSize) -> Self
Creates the single V1 window with its initial pane.
Sourcepub fn pane(&self, pane_index: u32) -> Option<&Pane>
pub fn pane(&self, pane_index: u32) -> Option<&Pane>
Returns the pane with the given stable pane index.
Sourcepub fn pane_mut(&mut self, pane_index: u32) -> Option<&mut Pane>
pub fn pane_mut(&mut self, pane_index: u32) -> Option<&mut Pane>
Returns a mutable pane reference for the given stable pane index.
Sourcepub const fn active_pane_index(&self) -> u32
pub const fn active_pane_index(&self) -> u32
Returns the active pane index owned by the window.
Sourcepub const fn last_pane_index(&self) -> Option<u32>
pub const fn last_pane_index(&self) -> Option<u32>
Returns the previously active pane index when one exists.
Sourcepub fn active_pane(&self) -> Option<&Pane>
pub fn active_pane(&self) -> Option<&Pane>
Returns the active pane when the window invariant is satisfied.
Sourcepub fn pane_id(&self, pane_index: u32) -> Option<PaneId>
pub fn pane_id(&self, pane_index: u32) -> Option<PaneId>
Returns the stable internal pane identity for a display index.
Sourcepub const fn layout(&self) -> LayoutName
pub const fn layout(&self) -> LayoutName
Returns the last selected named layout for the window.
Sourcepub const fn size(&self) -> TerminalSize
pub const fn size(&self) -> TerminalSize
Returns the terminal size currently backing the window.
Sourcepub fn layout_dump(&self) -> String
pub fn layout_dump(&self) -> String
Returns the tmux-compatible serialized layout tree for the window.
Sourcepub fn save_old_layout(&mut self)
pub fn save_old_layout(&mut self)
Saves the current serialized layout as the tmux-compatible old layout.
Sourcepub fn old_layout(&self) -> Option<&str>
pub fn old_layout(&self) -> Option<&str>
Returns the previously saved serialized layout when one exists.
Sourcepub fn name(&self) -> Option<&str>
pub fn name(&self) -> Option<&str>
Returns the explicit user-supplied window name when one exists.
Sourcepub const fn automatic_rename(&self) -> bool
pub const fn automatic_rename(&self) -> bool
Returns whether automatic renaming remains enabled for the window.
Sourcepub const fn alert_flags(&self) -> AlertFlags
pub const fn alert_flags(&self) -> AlertFlags
Returns any queued runtime alert flags for the window.
Sourcepub const fn alerts_queued(&self) -> bool
pub const fn alerts_queued(&self) -> bool
Returns whether alert processing is already queued for this window.
Sourcepub fn pane_count(&self) -> usize
pub fn pane_count(&self) -> usize
Returns the number of panes in the window.
Sourcepub fn queue_alerts(&mut self, flags: AlertFlags)
pub fn queue_alerts(&mut self, flags: AlertFlags)
Queues alert flags for later server-side processing.
Sourcepub fn take_alert_flags(&mut self) -> AlertFlags
pub fn take_alert_flags(&mut self) -> AlertFlags
Drains and returns all queued alert flags.
Sourcepub fn clear_alert_flags(&mut self, flags: AlertFlags)
pub fn clear_alert_flags(&mut self, flags: AlertFlags)
Clears the provided queued alert flags.
Sourcepub fn set_alerts_queued(&mut self, queued: bool)
pub fn set_alerts_queued(&mut self, queued: bool)
Sets whether alert processing is already queued.
Sourcepub fn set_automatic_name(&mut self, name: String)
pub fn set_automatic_name(&mut self, name: String)
Updates the runtime window name while preserving automatic renaming.