Libghostty Is Coming

· devtools · Source ↗

TLDR

  • Mitchell Hashimoto is extracting Ghostty’s terminal core into libghostty-vt, a zero-dependency C library for embedding correct terminal emulation anywhere.

Key Takeaways

  • libghostty-vt is the first component: a zero-dependency (no libc) library for parsing terminal sequences and maintaining state like cursor position and styles.
  • The library is extracted directly from Ghostty’s battle-tested core, inheriting SIMD-optimized parsing, Unicode support, and fuzz/Valgrind-tested correctness.
  • The Zig API is available now for early testing; the C API is in progress and expected shortly, targeting macOS and Linux on x86_64 and aarch64.
  • Longer-term libghostty-<x> libraries are planned for input handling, GPU rendering (OpenGL/Metal), and full GTK/Swift terminal view widgets.
  • A tagged stable release of libghostty-vt is targeted within 6 months, versioned independently from Ghostty the application.

Why It Matters

  • Most existing terminal emulation implementations (JetBrains’ Jediterm, GitHub Actions, Vercel build logs) are ad-hoc, incomplete, and buggy due to the hidden complexity of the full VT state machine.
  • A single correct, reusable C library lets editors, CI platforms, and hosting providers eliminate a non-core engineering problem that currently causes real user-facing bugs.
  • Early API feedback is actively sought via the Ghostty Discord; the core logic is stable, but the public C API surface is still being designed.

Mitchell Hashimoto · 2025-09-22 · Read the original