Two classes matter most when reasoning about terminal behavior:
Consolehandles screen-facing behavior such as clearing, sizing, cursor placement, and buffered writes.InputManagerhandles 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.