STB-style single-header ANSI terminal UI library in C89 with first-class Zig bindings.
Overview
Drop-in header: define ZETUI_IMPLEMENTATION in one translation unit,
include everywhere else. Zero external dependencies, POSIX-only. C89 compliant
throughout, with its own integer typedefs and an opaque handle that hides struct layout.
Architecture
Application --> zetui_ctx_t (opaque)
|-- termios raw mode / POSIX read
|-- diff cell buffer --> escape sequence writer
|-- SIGWINCH (volatile sig_atomic_t, EINTR retry)
Features
- Diff-based rendering: only changed cells emitted per frame, correct style-reset logic
- Built-in UTF-8 encoding and decoding
- Correct POSIX signal handling and retry-on-partial-write in output buffer flush
- Opaque handle pattern; C89 compliant throughout
- First-class Zig bindings built alongside the C library
Stack
C89 · Zig · POSIX
Build
Use the header directly from C, or build a static library and Zig bindings
with zig build. The build requires Zig 0.16 or newer.
Notes
Built to have a dependency-free TUI layer that works from C89 and Zig without pulling in ncurses or any external runtime.