Expand description
inkferro-rt: line-diff transport.
A pure &str -> bytes port of ink’s createIncremental render path
(ink/src/log-update.ts, ~lines 174-310). No terminal IO, no streams, no
threads, no cursor-position machinery.
Scope (M2-E / M2 flicker policy): incremental rendering is the only mode.
The TS createIncremental couples to a Writable stream only through
.write() and cli-cursor, both pure terminal IO. With showCursor:true
and no setCursorPosition, the cursor branch collapses: activeCursor
stays undefined, cursorWasShown stays false, so returnPrefix and
cursorSuffix are always "". The remaining render logic depends on the
input string alone – no rows/columns terminal-height dependence – so
the pure &str -> bytes contract holds.
Structs§
- Cursor
Pos - A terminal cursor position, mirroring ink’s
CursorPosition(ink/src/cursor-helpers.ts:3-6,{x, y}).x/yare 0-based cell coordinates within the rendered frame; the napi boundary maps itsu32CursorPosonto thisusizeform for the escape arithmetic. - Frame
Params - Per-frame inputs to
FrameWriter::write_frame. - Frame
Writer - Stateful frame emitter owning a
LineDiffplus the small amount of cross-frame state ink keeps on itsInkinstance. - Line
Diff - Incremental line-diff transport: a stateful
&str -> Vec<u8>writer that emits the minimal ANSI byte sequence to transform the previously rendered frame into the next one, mirroring ink’screateIncremental.
Constants§
- bsu
- Begin Synchronized Update (DECSET 2026):
ESC [ ? 2026 h. - esu
- End Synchronized Update (DECRST 2026):
ESC [ ? 2026 l.
Functions§
- should_
clear_ terminal_ for_ frame - Whether the next frame must perform a full terminal clear rather than an incremental diff.
- should_
synchronize - Whether synchronized output should wrap a write.