pub struct TerminalGrid { /* private fields */ }Expand description
A terminal grid fed incrementally with raw PTY bytes. The daemon (Wave 3)
owns one per PTY-managed agent and feeds it from the PTY drainer’s ring; a
ReadinessDetector inspects its
snapshot to decide whether the CLI is ready.
Implementations§
Source§impl TerminalGrid
impl TerminalGrid
Sourcepub fn new(rows: u16, cols: u16) -> Self
pub fn new(rows: u16, cols: u16) -> Self
Construct a grid of the given size. Zero dimensions are clamped to 1 so the parser never panics on a degenerate winsize.
Sourcepub fn with_default_size() -> Self
pub fn with_default_size() -> Self
Construct a grid at the 24x80 default size.
Sourcepub fn feed(&mut self, bytes: &[u8])
pub fn feed(&mut self, bytes: &[u8])
Feed raw PTY output. Safe to call with partial escape sequences split
across reads; the underlying vte parser buffers incomplete sequences
between advance calls.
Sourcepub fn resize(&mut self, rows: u16, cols: u16)
pub fn resize(&mut self, rows: u16, cols: u16)
Resize the grid, mirroring a PTY winsize change. Dimensions are clamped to 1.
Sourcepub fn snapshot(&self) -> OwnedScreen
pub fn snapshot(&self) -> OwnedScreen
Snapshot the current screen into an owned holder a ScreenView can
borrow from. visible_text is plain text (no formatting): one line per
grid row with trailing blank cells trimmed, exactly what a human would
see and what the readiness detectors substring-match against. Cursor is
0-indexed (row, col) (preserved from the prior vt100 contract).