Skip to main content

Module log_update

Module log_update 

Source
Expand description

Inline rendering with line tracking and erasure.

This is the clever bit that makes Blaeck different from fullscreen TUIs.

LogUpdate enables Ink-style inline rendering by:

  1. Tracking how many lines were written in the previous render
  2. On re-render: move cursor up N lines, erase each line, write new content
  3. Remembering the new line count for next time

ANSI sequences used:

  • ESC[nA — cursor up n lines
  • ESC[2K — erase entire line
  • ESC[0G — cursor to column 0

This creates the illusion of in-place updates without alternate screen mode.

Based on Ink’s log-update.ts. See refs/ink/src/log-update.ts for the original.

Structs§

LogUpdate
LogUpdate manages inline terminal rendering by tracking line counts and erasing previous output before writing new content.

Type Aliases§

Result
Result of a LogUpdate operation.