Scripting API

Console and Input

Console output and input management work together to make the runtime feel immediate inside a real terminal.

1 min read Terminal IO console input terminal

Two classes matter most when reasoning about terminal behavior:

  • Console handles screen-facing behavior such as clearing, sizing, cursor placement, and buffered writes.
  • InputManager handles raw key reads, escape-sequence interpretation, and dispatch into the runtime.

Keeping those concerns separate is important. Output code should not need to understand gameplay semantics, and input code should not need to know how scenes draw themselves. Each side translates terminal behavior into a clean enough surface for the engine to use.

This is also the most likely area to revisit when improving portability across macOS, Linux, and different terminal emulators.