pub struct TerminalSnapshot {
pub cells: Arc<[Cell]>,
pub rows: u16,
pub cols: u16,
pub cursor_row: u16,
pub cursor_col: u16,
pub cursor_visible: bool,
pub cursor_shape: CursorShape,
pub title: Option<String>,
pub alt_screen: bool,
pub scroll_offset: u32,
pub scrollback_rows: u32,
pub seq: u64,
}Expand description
One published frame. Renderer reads via
Arc<ArcSwap<TerminalSnapshot>> — .load() is wait-free.
The cells slice is row-major: cell at (row, col) lives at
cells[row * cols + col]. Always exactly rows * cols
long.
seq is a monotonic frame counter — renderers can skip a
repaint when the loaded snapshot’s seq matches the
last-painted one.
Fields§
§cells: Arc<[Cell]>§rows: u16§cols: u16§cursor_row: u16§cursor_col: u16§cursor_visible: bool§cursor_shape: CursorShape§title: Option<String>None = no OSC 0/2 title received yet; renderer falls
back to the buffer’s label.
alt_screen: boolTrue while the program is on the xterm “alternate screen” buffer (vim, less, htop, etc.). Renderers can use this to disable the modeline-scrollback indicator.
scroll_offset: u32T3 (2026-05-25): rows scrolled back from the live edge.
0 = live; positive values expose scrollback. Renderers
surface this on the modeline so the user can tell at a
glance they’re viewing history.
scrollback_rows: u32T3 (2026-05-25): current number of rows held in
scrollback (history that has scrolled off the live
screen). Grows as rows roll off; bounded by the
configured terminal.scrollback-lines. Used by the
modeline / status line to render a “row N of M”
indicator and to gate scroll-up motions.
seq: u64Monotonic per-terminal frame counter.
Implementations§
Source§impl TerminalSnapshot
impl TerminalSnapshot
Sourcepub fn empty() -> Self
pub fn empty() -> Self
Empty 24×80 snapshot — the vim/xterm-conventional fallback size for
contexts with no real spawn geometry yet (tests, Default). NOT used
by spawn()’s initial publish — see Self::empty_sized.
Sourcepub fn empty_sized(rows: u16, cols: u16) -> Self
pub fn empty_sized(rows: u16, cols: u16) -> Self
Empty snapshot at a CALLER-SUPPLIED size. spawn() publishes this
(at the real SpawnConfig::{rows,cols}) as the placeholder shown
before the reader thread processes the child’s first output chunk.
Regression (2026-07-02): spawn() used to publish Self::empty()
unconditionally — a hardcoded 24×80 disconnected from the real spawn
size. The alacritty Term (build_term) and the kernel PTY
(openpty) were ALWAYS sized correctly from SpawnConfig; only this
placeholder lied about it. When the real pane is taller than 24 rows
(the common case), a paint landing in the placeholder’s brief window
caps rows_to_paint at 24, and — critically — the mismatch does NOT
self-correct via a renderer resize the way the old doc comment
claimed: SetPaneViewport’s diff-then-send gate only fires a PTY
resize when the computed row count DIFFERS from the pane’s already-
published viewport_height, which do_terminal_spawn already read
to size the spawn — so there is no delta to trigger a correcting
resize. The window closes only once the reader thread republishes a
snapshot from real output, whenever that first arrives.
Trait Implementations§
Source§impl Clone for TerminalSnapshot
impl Clone for TerminalSnapshot
Source§fn clone(&self) -> TerminalSnapshot
fn clone(&self) -> TerminalSnapshot
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TerminalSnapshot
impl Debug for TerminalSnapshot
Auto Trait Implementations§
impl Freeze for TerminalSnapshot
impl RefUnwindSafe for TerminalSnapshot
impl Send for TerminalSnapshot
impl Sync for TerminalSnapshot
impl Unpin for TerminalSnapshot
impl UnsafeUnpin for TerminalSnapshot
impl UnwindSafe for TerminalSnapshot
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.