Skip to content

terminal: glyph protocol parser and response encoder#12352

Open
mitchellh wants to merge 1 commit intomainfrom
push-rxukqqxmnmnw
Open

terminal: glyph protocol parser and response encoder#12352
mitchellh wants to merge 1 commit intomainfrom
push-rxukqqxmnmnw

Conversation

@mitchellh
Copy link
Copy Markdown
Contributor

@mitchellh mitchellh commented Apr 20, 2026

Important: this DOES NOT hook up the glyph protocol to Ghostty or libghostty. Its just the parser.

This adds the core parse/encode for the still in-development and experimental terminal glyph protocol: raphamorim/rio#1542

The only cross-cutting change necessary was changing the APC identification logic which previously only looked at a single byte to support multi-byte identifiers since the glyph protocol uses 25a1.

For DoS protection, the default limits any glyph-related APC command size to 1 megabyte.

Warning

Since this protocol is still in development and discussion, there is no promise the implementation will stay within Ghostty or that any of the APIs exposed by this will remain stable. We're just getting ahead of it.

@mitchellh mitchellh added this to the 1.4.0 milestone Apr 20, 2026
@mitchellh mitchellh requested a review from a team as a code owner April 20, 2026 16:25
@mitchellh mitchellh added the vt Control sequence related label Apr 20, 2026
@mitchellh mitchellh force-pushed the push-rxukqqxmnmnw branch 2 times, most recently from c7ca915 to 75aff66 Compare April 20, 2026 16:39
@mitchellh
Copy link
Copy Markdown
Contributor Author

Updates:

  • Update to the latest spec v1.4 which modified some formats
  • Have get apply defaults automatically for specified defaults (invalid values are not validated)
  • Clear does not echo the codepoint back

mitchellh added a commit that referenced this pull request Apr 23, 2026
This code was motivated by the need for the glyph protocol handler
(#12352) to be able to validate the provided `glyf` payload, without
having to link freetype or anything (because libghostty-vt needs to be
static). As such it's written specifically to meet those needs, but in
such a way that it can be expanded if we find a need for more in-depth
inspection of `glyf`s in the future.
This adds the core parse/encode for the still in-development and experimental
terminal glyph protocol: raphamorim/rio#1542

The only cross-cutting change necessary was changing the APC
identification logic which previously only looked at a single byte to
support multi-byte identifiers since the glyph protocol uses `25a1`.
@mitchellh mitchellh force-pushed the push-rxukqqxmnmnw branch from f403485 to 3d896ca Compare May 6, 2026 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

vt Control sequence related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant