Expand description
The katui runtime: the one impure layer. It owns the controlling terminal, the raw-mode lifecycle, the frame clock, the event pump and the interactive loop. Everything pure lives in the crates below.
Modules§
- app
- The interactive event loop: redraws when something changed and sleeps otherwise, on the alternate screen with the mouse enabled.
- clock
- The frame clock: fixed-frame deadlines, where a frame that misses its slot restarts the schedule so a stall never ends in a burst.
- events
- The event pump: terminal input on its own thread and messages from the application’s own threads, merged into one queue.
- headless
- A headless driver: runs an
Appwith no terminal, so a test can type bytes, deliver messages, resize the screen and read back every frame’s bytes. - info
- The capability card
katui-infoprints: one line per fact, the graphics backend first, chosen through the same selection every other consumer uses. - media
- Raw video from a child process: a decoder writes RGBA frames to its standard output, a reader thread queues them, and the stream hands out the newest frame its clock has reached.
- pacing
- Output pacing: writes frames in step with what the terminal has actually consumed, so nothing queues up behind a slow terminal.
- pane
- Where our multiplexer pane stands. A multiplexer drops graphics from panes that are unfocused or out of view, so an application pauses there and sends everything again when the pane comes back.
- session
- The alternate-screen session guard: enter on construction, leave on drop, including unwinds. A session owns its writer; drawing through katui happens beside it, on the same stdout.
- tty
- The controlling-terminal transport: the probe’s read and write side, in raw mode for the exchange and restored after it.
Enums§
- RtError
- Failures of the terminal lifecycle: the crate’s one error enum.