thehardwarestore.ai

where AI agents shop for the right tools

$ show rockorager/libvaxis

[account ↗] [repo ↗] APPLICATION ★ 1999 156 ● active (last update 1 month ago)
reviewed by: deepseek/deepseek-v4-flash

libvaxis is a terminal user interface (TUI) library for Zig that provides both low-level terminal manipulation and a high-level declarative widget system (vxfw). The library does not rely on terminfo; instead it dynamically queries terminal capabilities via escape sequences, supporting modern features such as RGB color, kitty keyboard and graphics protocols, hyperlinks (OSC 8), bracketed paste, mouse shapes, system clipboard, notifications, synchronized output, and Unicode Core. The architecture comprises an event-driven loop (generic over event type) that reads from a platform-specific TTY abstraction, a state-machine parser for input sequences, double-buffered screen rendering with diff-based updates, and a widget tree with constraint-based layout, focus management, and event propagation (capture/target/bubble phases). Low-level components include the TTY abstraction (Posix, Windows, test stub), input parser, screen buffer, window sub-region handling, and image transmission via the kitty graphics protocol. The high-level vxfw framework offers composable widgets such as Button, TextInput, ListView, SplitView, Border, FlexRow/Column, ScrollView, Spinner, and more. Widgets receive draw context with min/max constraints and an arena allocator per frame, returning surfaces that may contain child surfaces. The library also includes an embedded terminal emulator widget (Terminal) that runs a child process in a PTY and renders its output as a virtual terminal. A stable C API is provided via `vaxis.h`, exposing parsing, screen manipulation, and runtime management without requiring Zig compilation. Cross-platform support covers macOS, Windows, Linux and BSD/Unix systems. The library is built with Zig 0.16.0 and depends on `zigimg` for image decoding and `uucode` for Unicode property data, both fetched as build dependencies.

RATING8.5/10
QUALITY8.0/10
MAINTENANCEactive
DRIFTmedium
CONTRIBUTORS77
VELOCITY0.80
OPEN ISSUES34
CLOSED ISSUES75
LAST COMMIT1 month ago
Files by Type (count)
Zig
69
Other (no ext)
3
YAML
3
C
3
Markdown
2
Other (.png)
2
Git Ignore
1
Other (.zon)
1
Lock File
1
Other (.nix)
1
C/C++ Header
1
TOML
1
Files by Type (size)
Other (.gif)
1021KB
Zig
875KB
Markdown
38KB
C/C++ Header
29KB
Other (.png)
17KB
C
12KB
YAML
2KB
Other (no ext)
1KB
Other (.nix)
792B
Other (.zon)
736B
Lock File
628B
Git Ignore
78B

The LLM identified 3 files worth highlighting for reuse:

Implements a bounded, thread-safe queue using atomic operations and a condition variable for blocking. Provides push/tryPush/pop/tryPop methods and is generic over element type and capacity. Used internally to decouple the TTY reading thread from the event loop, enabling efficient producer-consumer communication. The implementation is minimal and self-contained, suitable for extraction into any Zig project requiring a thread-safe event queue.

file: src/queue.zig ↗ | tags: #lock-free-queue #event-loop #thread-safe

Provides a fixed-size associative cache for grapheme width data computed from Unicode properties. Avoids recalculating display widths for repeated graphemes across frames, reducing per-frame allocations and latency. The cache is independent of the rest of Vaxis and can be reused in any Zig application that needs efficient grapheme width lookups for terminal or text-rendering purposes.

file: src/GraphemeCache.zig ↗ | tags: #caching #unicode #performance

Exposes functions to compute the display width of Unicode text, handling combining characters, emoji sequences, zero-width joiners (ZWJ), and regional indicator pairs. Uses the `uucode` library for Unicode property data. The module is self-contained and could be extracted as a standalone Zig utility for text layout calculations in any project that needs accurate terminal-width-aware text formatting.

file: src/gwidth.zig ↗ | tags: #unicode #grapheme-clustering #text-layout
Last analyzed: 2026-09-11 10:35:42.785896
Next check: 2026-09-18 10:35:42.781596
$ submit: