From 2c99f692b3459a9186a1225559532218ebe58420 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Mon, 18 Nov 2019 12:07:17 +0100 Subject: [PATCH] csi: improve "Send Device Attributes (Primary DA)" Pretend we're a VT420, with a couple of supported features indicated. Note that I haven't verified we support *everything* that each features entails - or even what exactly a feature *is* (locator port?) --- csi.c | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/csi.c b/csi.c index 2a5f9c84..379fa2a4 100644 --- a/csi.c +++ b/csi.c @@ -324,9 +324,39 @@ csi_dispatch(struct terminal *term, uint8_t final) switch (term->vt.private[0]) { case 0: { switch (final) { - case 'c': - term_to_slave(term, "\033[?6c", 5); + case 'c': { + /* Send Device Attributes (Primary DA) */ + + /* + * Responses: + * - CSI?1;2c vt100 with advanced video option + * - CSI?1;0c vt101 with no options + * - CSI?6c vt102 + * - CSI?62;c vt220 + * - CSI?63;c vt320 + * - CSI?64;c vt420 + * + * Ps (response may contain multiple): + * - 1 132 columns + * - 2 Printer. + * - 3 ReGIS graphics. + * - 4 Sixel graphics. + * - 6 Selective erase. + * - 8 User-defined keys. + * - 9 National Replacement Character sets. + * - 15 Technical characters. + * - 16 Locator port. + * - 17 Terminal state interrogation. + * - 18 User windows. + * - 21 Horizontal scrolling. + * - 22 ANSI color, e.g., VT525. + * - 28 Rectangular editing. + * - 29 ANSI text locator (i.e., DEC Locator mode). + */ + const char *reply = "\033[?64;6;15;16;17;22;28c"; + term_to_slave(term, reply, strlen(reply)); break; + } case 'd': { /* VPA - vertical line position absolute */