Skip to main content

Window

Struct Window 

Source
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

Source

pub const fn created_at(&self) -> i64

Returns the window creation timestamp as Unix seconds.

Source

pub const fn activity_at(&self) -> i64

Returns the last window activity timestamp as Unix seconds.

Source

pub fn touch_activity_for_pane(&mut self, pane_index: u32) -> bool

Records output activity for a specific pane in this window.

Source

pub fn pane_activity_snapshot( &self, pane_id: PaneId, ) -> Option<WindowPaneActivity>

Captures the window and pane activity timestamps for a stable pane.

Source

pub fn apply_pane_activity_snapshot( &mut self, activity: WindowPaneActivity, ) -> bool

Applies activity captured from another occurrence of the same linked window.

Source§

impl Window

Source

pub const fn is_zoomed(&self) -> bool

Returns whether this window is currently zoomed.

Source§

impl Window

Source

pub fn new(size: TerminalSize) -> Self

Creates the single V1 window with its initial pane.

Source

pub const fn id(&self) -> WindowId

Returns the stable internal window identity.

Source

pub fn panes(&self) -> &[Pane]

Returns the panes in window order.

Source

pub fn pane(&self, pane_index: u32) -> Option<&Pane>

Returns the pane with the given stable pane index.

Source

pub fn pane_mut(&mut self, pane_index: u32) -> Option<&mut Pane>

Returns a mutable pane reference for the given stable pane index.

Source

pub const fn active_pane_index(&self) -> u32

Returns the active pane index owned by the window.

Source

pub const fn last_pane_index(&self) -> Option<u32>

Returns the previously active pane index when one exists.

Source

pub fn active_pane(&self) -> Option<&Pane>

Returns the active pane when the window invariant is satisfied.

Source

pub fn pane_id(&self, pane_index: u32) -> Option<PaneId>

Returns the stable internal pane identity for a display index.

Source

pub const fn layout(&self) -> LayoutName

Returns the last selected named layout for the window.

Source

pub const fn size(&self) -> TerminalSize

Returns the terminal size currently backing the window.

Source

pub fn layout_dump(&self) -> String

Returns the tmux-compatible serialized layout tree for the window.

Source

pub fn save_old_layout(&mut self)

Saves the current serialized layout as the tmux-compatible old layout.

Source

pub fn old_layout(&self) -> Option<&str>

Returns the previously saved serialized layout when one exists.

Source

pub fn name(&self) -> Option<&str>

Returns the explicit user-supplied window name when one exists.

Source

pub const fn automatic_rename(&self) -> bool

Returns whether automatic renaming remains enabled for the window.

Source

pub const fn alert_flags(&self) -> AlertFlags

Returns any queued runtime alert flags for the window.

Source

pub const fn alerts_queued(&self) -> bool

Returns whether alert processing is already queued for this window.

Source

pub fn pane_count(&self) -> usize

Returns the number of panes in the window.

Source

pub fn queue_alerts(&mut self, flags: AlertFlags)

Queues alert flags for later server-side processing.

Source

pub fn take_alert_flags(&mut self) -> AlertFlags

Drains and returns all queued alert flags.

Source

pub fn clear_alert_flags(&mut self, flags: AlertFlags)

Clears the provided queued alert flags.

Source

pub fn set_alerts_queued(&mut self, queued: bool)

Sets whether alert processing is already queued.

Source

pub fn enable_automatic_rename(&mut self)

Re-enables runtime automatic renaming for this window.

Source

pub fn set_automatic_name(&mut self, name: String)

Updates the runtime window name while preserving automatic renaming.

Trait Implementations§

Source§

impl Clone for Window

Source§

fn clone(&self) -> Window

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Window

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Window

Source§

impl PartialEq for Window

Source§

fn eq(&self, other: &Window) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Window

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.