From bc685fb3f3d66c5d31fcc2798b9c766e28fa42a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Eric=20Janouch?=
Date: Sun, 27 Sep 2020 22:26:33 +0200 Subject: [PATCH] Try to detect Sixel support via DA1 report --- termtest.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/termtest.c b/termtest.c index 4e8bbd9..cc6277e 100644 --- a/termtest.c +++ b/termtest.c @@ -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");