1 How it works🔗ℹ

Every output path in base funnels through format-* (which produces ANSI bytes) and put-* (which writes them). The character backend keeps the same API but substitutes two leaves:

  • format-* returns an op (or op sequence) instead of ANSI bytes, and

  • put-* applies those ops to the character grid.

Because the semantic information is available at the formatter, there is no ANSI parsing on the main path. bytes-append is shadowed (module-locally) by an op concatenator so the documented batch idiom keeps working verbatim:

(bytes-append format-screen-clear (format-cursor-move 1 1) "hi")

An ANSI parser (make-ansi-parser) is retained only as a test oracle: the same UI rendered through ops and through ANSI bytes must agree.