HeadlinesBriefing favicon HeadlinesBriefing.com

Attyx Terminal Emulator: Tiny GPU Terminal Built in Zig

Hacker News •
×

Attyx is a deterministic VT-compatible terminal emulator built entirely in Zig that prioritizes correctness over features. The project takes a unique approach by implementing a pure state machine architecture that requires no PTY, windowing, or platform APIs for its core functionality. Given identical input bytes, Attyx always produces the same grid state, making it highly testable and predictable.

The architecture follows a strict pipeline where parsing never touches state and state never influences parsing. The core consists of a parser, terminal state, and grid renderer that work together through a simple feed(bytes) API. Attyx supports both macOS with Metal rendering and Linux with OpenGL, using FreeType for font rendering. The project includes comprehensive golden snapshot testing in headless mode, allowing developers to verify terminal behavior without requiring a display or PTY.

With a focus on clarity over cleverness, Attyx provides a minimal but complete terminal experience. The codebase is organized into clear layers including the terminal engine, headless runner, configuration system, application layer, and renderer. At just 83 commits, this tiny terminal emulator demonstrates how a focused, well-architected approach can create a functional and fast GPU-accelerated terminal from scratch.