@@ -191,8 +191,14 @@ TermGraphicsInfo QuerySupportedGraphicsProtocol() {
191
191
result.known_broken_sixel_cursor_placement = false ;
192
192
result.in_tmux = false ;
193
193
194
+ // Environment variables can be changed, so guesses from environment
195
+ // variables are just that: guesses.
196
+ // They will help as a fallback if the [>q query does not work.
197
+ // Only testing environment variables with very specific content.
198
+
194
199
const char *const term = getenv (" TERM" );
195
- if (term && strcmp (term, " xterm-kitty" ) == 0 ) {
200
+ if (term && ((strcmp (term, " xterm-kitty" ) == 0 ) ||
201
+ (strcmp (term, " xterm-ghostty" ) == 0 ))) {
196
202
result.preferred_graphics = GraphicsProtocol::kKitty ;
197
203
// Fall through, as we still have to determine if we're in tmux
198
204
}
@@ -235,6 +241,9 @@ TermGraphicsInfo QuerySupportedGraphicsProtocol() {
235
241
if (contains (data, len, " kitty" )) {
236
242
result.preferred_graphics = GraphicsProtocol::kKitty ;
237
243
}
244
+ if (contains (data, len, " ghostty" )) {
245
+ result.preferred_graphics = GraphicsProtocol::kKitty ;
246
+ }
238
247
if (contains (data, len, " mlterm" )) {
239
248
result.preferred_graphics = GraphicsProtocol::kSixel ;
240
249
}
0 commit comments