mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-09-20 04:28:06 +00:00
A normal renderer would have to call `ghostty_render_state_get` _eight times_ to reconstruct the cursor. In languages where FFI is expensive (Go, wasm, etc.), this showed up in profiles of every frame. Add a sized cursor snapshot and expose it. Also expose the existing color snapshot through ghostty_render_state_get and remove the older dedicated color getter.
Example: ghostty-vt Render State
This contains an example of how to use the ghostty-vt render-state API
to create a render state, update it from terminal content, iterate rows
and cells, read styles and colors, inspect cursor and row-local selection
state, and manage dirty tracking.
This uses a build.zig and Zig to build the C program so that we
can reuse a lot of our build logic and depend directly on our source
tree, but Ghostty emits a standard C library that can be used with any
C tooling.
Usage
Run the program:
zig build run