I’m expanding libghostty’s terminal APIs so embedders can build integrations and terminal tools with less setup. These capabilities include Zig access to terminal functionality, simpler stream processing, and Kitty graphics rendering; apps built with libghostty shows projects built on the library.
I told @thdxr that I knew OpenTUI is in Zig, and that all of this stuff is already exposed via the Zig module, so they were good to go.
I simplified libghostty’s Zig API for the common terminal-state-only case; developers can now process terminal streams and update terminal state in just a handful of lines of code.
This simpler stream-processing API is useful for terminal replay tooling, including “CIs, PaaS (the build step), Asciinema-style things, etc.”
Previously, developers had to “create a custom "handler" type” before initializing a parser and inspecting the Zig source.
I shared that a contributor was “already being done by a contributor unofficially; we'll probably not use this directly” regarding a tmux replacement based on libghostty.
I said Libghostty now fully exposes the Kitty Graphics Protocol, making this available to anyone embedding Ghostty; this extends the protocol work documented in kitty protocol support.
I added a full Kitty graphics renderer to Ghostling, the libghostty demo project, in ~270 LoC.
Ghostty GUI has supported Kitty graphics since version 1.0, and I believe we have one of the most comprehensive Kitty graphics protocol implementations besides Kitty itself.
I said Ghostty: we support unicode placeholders which lets the protocol work in tmux, which is -- I think -- only supported by Ghostty besides Kitty.
I described the Kitty graphics implementation as robust and proven in real-world use, with this availability and enablement: available to anyone embedding Ghostty; Enable it with a few lines of code.
I said an embedder can build a renderer with a couple hundred lines, as shown in Ghostling.
I shared the Ghostling renderer pull request at https://t.co/HXs9vxCgmY.
Related: expanding c api capabilities, webassembly terminal support, apps built with libghostty