Add Parser and Terminal C API to libghostty-vt #11348
Replies: 4 comments 2 replies
-
|
I see that @mitchellh added #11506, I have 4 more commits for VT state stuff at https://github.com/domenkozar/ghostty/commits/vt-state-query-c-api/ |
Beta Was this translation helpful? Give feedback.
-
|
Updated branch rebased on main and Terminal state queries:
Row/cell/style access:
VT stream parser:
Content serialization:
Host terminal control:
Write extensions:
Branch: https://github.com/domenkozar/ghostty/tree/vt-state-query-c-api |
Beta Was this translation helpful? Give feedback.
-
|
Thanks @domenkozar I just noticed this discussion. This will help me with the roadmap on some of the stuff I'm working on. |
Beta Was this translation helpful? Give feedback.
-
|
Remaining commits not yet covered by main: Scrollback row count queries:
VT stream parser:
Content serialization:
Host terminal control:
Write extensions:
Branch: https://github.com/domenkozar/ghostty/tree/vt-state-query-c-api |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Following the work in #8840, I'd like to extend the libghostty-vt C API with bindings for the VT parser and terminal emulator.
Parser API exposes the state machine for byte-by-byte parsing of VT escape sequences (CSI, ESC, DCS, OSC, APC), with accessors for sequence details.
Terminal API provides a higher level write/read interface for full terminal emulation: write bytes (including escape sequences), query cursor position, get screen dimensions, resize, and extract plain text content.
Both follow existing conventions in
src/terminal/c/(opaque handles, allocator parameter, Result return type) and include C headers with documentation.Branch with implementation: https://github.com/domenkozar/ghostty/tree/libvt-c-apiCode was written using Claude Opus 4.6 via Claude Code.
Beta Was this translation helpful? Give feedback.
All reactions