Documentation
¶
Overview ¶
Package termsim is a headless ANSI terminal simulator for byte-level parity testing. It accepts an ANSI byte stream (CSI/SGR/OSC/cursor moves) and reconstructs the final terminal state as a 2D cell grid.
Mirrors only the subset of escape sequences the pi-tui renderer actually emits. New sequences MUST be added as upstream pi-tui starts emitting them.
Reference: .upstream/current/packages/tui/src/tui.ts (renderer) for the emitter side; this is the consumer side.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cell ¶
Cell is one terminal column. Wide chars occupy two cells; the second has Continuation=true and Rune=0. Empty cells have Rune=' '.
type Grid ¶
type Grid struct {
Rows, Cols int
// contains filtered or unexported fields
}
Grid is the simulated terminal state.
func (*Grid) Scrollback ¶
Scrollback returns rows that have scrolled past the top of the grid.
func (*Grid) String ¶
String returns the visible content as a newline-joined string with trailing spaces trimmed per row.
func (*Grid) SyncDepth ¶
SyncDepth reports the current mode 2026 nesting (0 = not inside sync block).
func (*Grid) WriteString ¶
WriteString is the string variant of Write.