aboutsummaryrefslogtreecommitdiff
path: root/csi.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-02-16 11:00:58 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-06-13 15:19:41 +0000
commit3adc3367e69e1b1c13595167cb0dbeb48391ca83 (patch)
tree541797aefe25bda8bf1aa328c175b7b0c9928ce0 /csi.c
parentgenerate-version: add a define for “extra” version information (diff)
csi: implement XTVERSION (CSI > 0q)
This is a fairly new XTerm extension. The reply is on the format: DCS > | text ST XTerm replies with ‘text’ = “XTerm(366)”. Foot replies with ‘text’ = “foot(1.6.4)” Closes #359
Diffstat (limited to 'csi.c')
-rw-r--r--csi.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/csi.c b/csi.c
index 2d497636..fcc2800f 100644
--- a/csi.c
+++ b/csi.c
@@ -1565,6 +1565,22 @@ csi_dispatch(struct terminal *term, uint8_t final)
}
break; /* final == 'm' */
+ case 'q': {
+ /* XTVERSION */
+ if (vt_param_get(term, 0, 0) != 0) {
+ UNHANDLED();
+ break;
+ }
+
+ char reply[64];
+ size_t n = xsnprintf(
+ reply, sizeof(reply), "\033P>|foot(%u.%u.%u%s%s)\033\\",
+ FOOT_MAJOR, FOOT_MINOR, FOOT_PATCH,
+ FOOT_EXTRA[0] != '\0' ? "-" : "", FOOT_EXTRA);
+ term_to_slave(term, reply, n);
+ break;
+ }
+
default:
UNHANDLED();
break;