Libghostty Is Coming Date: September 22, 2025 Author: Mitchell Hashimoto --- Overview Libghostty is an embeddable library designed to bring modern, fast, and fully functional terminal emulation capabilities to any application. Originating from the Ghostty terminal emulator project, the initiative aims to provide reusable terminal emulation components as lightweight libraries, starting with libghostty-vt. --- Why Libghostty? Many applications implement terminal emulation, from dedicated terminal emulators like Ghostty, Kitty, or iTerm2 to terminal multiplexers (tmux, zellij) and code editors (JetBrains jediterm, VS Code’s Xterm.js). Various websites and hosting providers use read-only terminal emulation to display logs and command outputs, but these are often limited and ad-hoc implementations. Terminal emulation is complex with many edge cases; existing solutions are often incomplete, buggy, or slow. Developers frequently reinvent terminal emulation when it is not their core business, leading to inefficiencies. Libghostty aims to solve this by offering a cross-platform, minimal dependency library exposing a C API for broad embedding and consistency. --- The Beginning: libghostty-vt libghostty-vt is the first library in the libghostty family. It is a zero-dependency library (not even relying on libc) that: Parses terminal sequences, Maintains terminal state (cursor positions, styles, text wrapping), Handles complex ANSI and terminal control sequences. The parser is extracted from Ghostty’s proven core with features including: SIMD-optimized parsing, Strong Unicode support, Fuzz-tested, memory-efficient, and Valgrind-tested code, Compatibility with advanced protocols like Kitty Graphics and Tmux Control Mode. Provides a clean, embeddable C API suitable for many platforms. Initial support will be for macOS and Linux on x86_64 and aarch64, with planned expansion to Windows, embedded devices, and WebAssembly (WASM). --- Long-Term Vision Libghostty will evolve into a family of libraries: Additional components for input handling (e.g., keyboard encoding), GPU accelerated rendering (OpenGL, Metal surfaces), Higher-level UI widgets like GTK and Swift frameworks, All designed to be modular and minimize code size and dependencies. --- Current Status of libghostty-vt libghostty-vt has been exposed as a Zig module; Zig developers can start experimenting now. The C API is under active development and expected to be available soon for early testing. The existing internal C API used by Ghostty is not suitable for general use; libghostty will provide a clean, stable public API. Planned release of a stable tagged version within the next 6 months, contingent on readiness. Public alpha stage emphasizes API design feedback from early developers. --- Call for Feedback and Collaboration The libghostty project thrives on community input to shape its API. Developers interested in embedding terminal emulation into their projects are encouraged to join the Ghostty Discord or email the author. The core logic is stable and battle-tested, but the API surface is still evolving. Early adopters and contributors are welcomed to help mature libghostty. --- The Next Frontier With Ghostty the application stabilizing, focus is shifting toward libghostty. Libghostty aims to have a larger impact by serving multiple applications and environments. Continued development of Ghostty the app is ongoing and will benefit from the shared libghostty foundation. The project envisions much broader use and integration of terminal emulation via libghostty than a standalone terminal app can achieve. --- Footnotes Highlights Terminal multiplexers and editors embed full terminal emulation by managing their own ptys and escape code parsing. Existing shared libraries like libvte or Xterm.js cover