From 1681521c57fa458784a57d4fea1be90c0ee36619 Mon Sep 17 00:00:00 2001 From: nick black Date: Thu, 12 Aug 2021 01:20:52 -0400 Subject: [PATCH] move KITTYQUERY to IDQUERIES so as not to bleed through linux virtual console #2050 --- src/lib/termdesc.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/lib/termdesc.c b/src/lib/termdesc.c index 61e5cfc8c..2ab2e402f 100644 --- a/src/lib/termdesc.c +++ b/src/lib/termdesc.c @@ -317,10 +317,18 @@ init_terminfo_esc(tinfo* ti, const char* name, escape_e idx, // Replies with CSI > \d \d ; Pv ; [01] c #define SECDEVATTR "\x1b[>c" -// these three queries (terminated with a Primary Device Attributes, to which +// query for kitty graphics. if they are supported, we'll get a response to +// this using the kitty response syntax. otherwise, we'll get nothing. we +// send this with the other identification queries, since APCs tend not to +// be consumed by certain terminal emulators (looking at you, Linux console) +// which can be identified directly, sans queries. +#define KITTYQUERY "\x1b_Gi=1,a=q;\x1b\\" + +// these queries (terminated with a Primary Device Attributes, to which // all known terminals reply) hopefully can uniquely and unquestionably // identify the terminal to which we are talking. -#define IDQUERIES TRIDEVATTR \ +#define IDQUERIES KITTYQUERY \ + TRIDEVATTR \ XTVERSION \ XTGETTCAPTN \ SECDEVATTR @@ -349,12 +357,7 @@ init_terminfo_esc(tinfo* ti, const char* name, escape_e idx, // non-standard CSI for total pixel geometry #define GEOMPIXEL "\x1b[14t" -// query for kitty graphics. if they are supported, we'll get a response to -// this using the kitty response syntax. otherwise, we'll get nothing. -#define KITTYQUERY "\x1b_Gi=1,a=q;\x1b\\" - #define DIRECTIVES CSI_BGQ \ - KITTYQUERY \ SUMQUERY \ "\x1b[?1;3;256S" /* try to set 256 cregs */ \ CREGSXTSM \