AntOS Library — terminal (reference)

The terminal library's design and native core — coloured/attributed output plus a full-screen application mode with a strict init/teardown lifecycle. The script-facing API is luau_terminal.

What it is

Two levels: line output (colour, attributes — safe from any script) and application mode (alternate screen, raw key input, cursor control — for interactive tools). Output is constrained to the console glyph set.

Design notes

  • The init/shutdown contract is enforced in the core (re-entrancy guarded), so a misbehaving script can't leave the shared console in raw mode.
  • The renderer is Luau-agnostic, so the same output path serves the local console, the debug server, and the netImgui remote UI — application mode mirrors to a PC.
  • Text is a buffer the UI renders. A script's terminal output updates a shared text buffer that the render thread draws each frame; writing text is a thread-safe buffer update, not an ImGui call. This is what lets a text-only script run on a worker thread in parallel — it produces console output without ever touching the single ImGui context.
  • The glyph set is fixed and rendered procedurally; anything outside it shows as ?, so scripts keep output ASCII where possible (see the Quickstart glyph rules).

Native core — libantos_term

libantos_term owns the escape-sequence encoder, capability detection, the glyph table, and the raw-input decoder — no Luau. The binding marshals key events to/from Lua tables.

Related

Important: The Ant64 family of home computers are at early design/prototype stage, everything you see here is subject to change.