Skip to content

terminal/kitty: support graphics feature queries - #14866

Open
jcollie wants to merge 1 commit into
ghostty-org:mainfrom
jcollie:kitty-feature-query
Open

jcollie wants to merge 1 commit into
ghostty-org:mainfrom
jcollie:kitty-feature-query

Conversation

@jcollie

@jcollie jcollie commented Oct 27, 2026

Copy link
Copy Markdown
Member

Fixes #14843

A query action (a=q) with the "e" key set asks which of its keys are supported for the action named by "e", so that clients can detect features such as Unicode placeholders without hardcoding a list of terminals. The reply echoes "e" and every supported non-default key:

<ESC>_Ga=q,i=31,e=T,U=1<ESC>\  ->  <ESC>_Gi=31,e=T,U=1;OK<ESC>\

A feature query loads nothing, ignores its payload, and leaves any chunked load in progress alone. An unknown action gets a plain OK.

Mediums and PNG are only reported when they would actually work: t=f, t=t and t=s follow the image limits (and the target for shared memory), and f=100 requires a PNG decoder.

https://sw.kovidgoyal.net/kitty/graphics-protocol/#querying-support-for-protocol-features

AI disclosure: Claude Code was used in the preparation of this PR.

@jcollie
jcollie requested a review from a team as a code owner October 27, 2026 01:00
@jcollie jcollie added this to the 1.5.0 milestone Oct 27, 2026
Fixes ghostty-org#14843

A query action (a=q) with the "e" key set asks which of its keys are
supported for the action named by "e", so that clients can detect
features such as Unicode placeholders without hardcoding a list of
terminals. The reply echoes "e" and every supported non-default key:

    <ESC>_Ga=q,i=31,e=T,U=1<ESC>\  ->  <ESC>_Gi=31,e=T,U=1;OK<ESC>\

A feature query loads nothing, ignores its payload, and leaves any
chunked load in progress alone. An unknown action gets a plain OK.

Mediums and PNG are only reported when they would actually work: t=f,
t=t and t=s follow the image limits (and the target for shared memory),
and f=100 requires a PNG decoder.

https://sw.kovidgoyal.net/kitty/graphics-protocol/#querying-support-for-protocol-features
@jcollie
jcollie force-pushed the kitty-feature-query branch from 68ae0fa to 462d6d3 Compare November 7, 2026 02:39

@vancluever vancluever left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked over the code and I didn't see anything that stood out per se, but I want to refer this to @mitchellh to do a once-over as I haven't really been keeping up on the kitty graphics/unicode placeholder stuff. Do we have a way to test this though with say a tool that would otherwise fail if the inability to do the query doesn't exist?

@jcollie

jcollie commented Nov 11, 2026

Copy link
Copy Markdown
Member Author

Do we have a way to test this though with say a tool that would otherwise fail if the inability to do the query doesn't exist?

Support for querying is very new, even in Kitty. The only client (other than something in Kitty) that I know of is the discord client that the original discussion was about. I could certainly whip something up, but that wouldn't really reflect "real world" usage.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kitty graphics: support feature queries (e key) to detect Unicode placeholder support

2 participants