aboutsummaryrefslogtreecommitdiff
path: root/csi.c
diff options
context:
space:
mode:
Diffstat (limited to 'csi.c')
-rw-r--r--csi.c29
1 files changed, 26 insertions, 3 deletions
diff --git a/csi.c b/csi.c
index fe102ada..2122d272 100644
--- a/csi.c
+++ b/csi.c
@@ -13,10 +13,11 @@
#define LOG_ENABLE_DBG 0
#include "log.h"
#include "grid.h"
-#include "vt.h"
#include "selection.h"
#include "sixel.h"
#include "util.h"
+#include "version.h"
+#include "vt.h"
#define UNHANDLED() LOG_DBG("unhandled: %s", csi_as_string(term, final, -1))
#define UNHANDLED_SGR(idx) LOG_DBG("unhandled: %s", csi_as_string(term, 'm', idx))
@@ -373,8 +374,17 @@ csi_dispatch(struct terminal *term, uint8_t final)
* - 22 ANSI color, e.g., VT525.
* - 28 Rectangular editing.
* - 29 ANSI text locator (i.e., DEC Locator mode).
+ *
+ * Note: we report ourselves as a VT220, mainly to be able
+ * to pass parameters, to indiciate we support sixel, and
+ * ANSI colors.
+ *
+ * The VT level must be synchronized with the secondary DA
+ * response.
+ *
+ * Note: tertiary DA responds with "FOOT".
*/
- const char *reply = "\033[?62;4;6;15;17;22c";
+ const char *reply = "\033[?62;4;22c";
term_to_slave(term, reply, strlen(reply));
break;
}
@@ -1405,9 +1415,22 @@ csi_dispatch(struct terminal *term, uint8_t final)
* xterm uses its version number. We use an xterm
* version number too, since e.g. Emacs uses this to
* determine level of support.
+ *
+ * We report ourselves as a VT220. This must be
+ * synchronized with the primary DA respons.
+ *
+ * Note: tertiary DA replies with "FOOT".
*/
- term_to_slave(term, "\033[>41;347;0c", 12);
+ static_assert(FOOT_MAJOR < 100, "Major version must not exceed 99");
+ static_assert(FOOT_MINOR < 100, "Minor version must not exceed 99");
+ static_assert(FOOT_PATCH < 100, "Patch version must not exceed 99");
+
+ char reply[64];
+ snprintf(reply, sizeof(reply), "\033[>1;%02u%02u%02u;0c",
+ FOOT_MAJOR, FOOT_MINOR, FOOT_PATCH);
+
+ term_to_slave(term, reply, strlen(reply));
break;
case 'm':