Try to detect Sixel support via DA1 report

This commit is contained in:
Přemysl Eric Janouch 2020-09-27 22:26:33 +02:00
parent a742f3d9d2
commit bc685fb3f3
Signed by: p
GPG Key ID: A0420B94F92B9493

View File

@ -379,6 +379,16 @@ int main(int argc, char *argv[]) {
}
printf("-- Sixel graphics\n");
char *da1 = comm(CSI "c", false);
if (!strncmp(da1, CSI "?", 3)) {
char *p = da1 + 3, *end = p; long mode;
while ((mode = strtol(p, &end, 10)) && (*end == ';' || *end == 'c')) {
if (mode == 4)
printf("DA1: the terminal claims to support Sixel graphics.\n");
p = end + 1;
}
}
comm(CSI "4c" DCS "0;0;0;q??~~??~~??iTiTiT" ST, false);
printf("-- Mouse protocol\n");