Pure terminal-diff state machine for Vibe's TUI runtime.
Receives fully rendered semantic lines and a cursor position in document coordinates. Returns iodata to write to the terminal plus updated state.
Three render paths:
- First paint — writes all lines, creating native terminal scrollback.
- Viewport shift — scrolls via
\r\nthen repaints the visible area. - In-place patch — rewrites only changed lines within the current viewport.
Summary
Types
@type t() :: %Vibe.TUI.TerminalPainter{ cursor: {pos_integer(), pos_integer()}, hardware_row: pos_integer(), height: pos_integer(), lines: [IO.chardata()], viewport_top: pos_integer(), width: pos_integer() }
Functions
@spec cleanup() :: IO.chardata()
@spec new(pos_integer(), pos_integer()) :: t()
@spec render(t(), [IO.chardata()], {pos_integer(), pos_integer()}) :: {IO.chardata(), t()}
@spec resize(t(), pos_integer(), pos_integer()) :: t()