HeadlinesBriefing favicon HeadlinesBriefing.com

Ghostling Terminal Demo Shows libghostty's Flexibility

Hacker News •
×

Ghostling is a minimal terminal emulator built as a demo for libghostty, a C and Zig library extracted from Ghostty's core. The project, written in a single C file, uses Raylib for windowing and rendering to showcase how libghostty can be embedded in various contexts. It's intentionally simple, single-threaded, and uses 2D graphics rather than GPU rendering.

Libghostty-vt handles VT sequence parsing, terminal state management, and render state tracking without any dependencies, even libc. The library inherits Ghostty's proven features: accurate terminal emulation, SIMD-optimized parsing, Unicode support, and highly optimized memory usage. Ghostling demonstrates features like text reflow, 24-bit color support, Unicode handling, keyboard input with modifiers, mouse tracking, and scroll wheel support.

This demo isn't meant for daily use—it's a proof of concept showing libghostty's flexibility. The project uses CMake and Raylib for convenience, but libghostty works with any renderer or GUI framework. While Ghostling omits features like tabs, splits, and session management to stay minimal, it proves that developers can build custom terminal applications on top of libghostty's robust core. The Ghostty team hopes this encourages community bindings for other languages beyond C and Zig.