diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2021-02-16 11:00:58 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-06-13 15:19:41 +0000 |
| commit | 3adc3367e69e1b1c13595167cb0dbeb48391ca83 (patch) | |
| tree | 541797aefe25bda8bf1aa328c175b7b0c9928ce0 | |
| parent | generate-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
| -rw-r--r-- | CHANGELOG.md | 3 | ||||
| -rw-r--r-- | csi.c | 16 |
2 files changed, 19 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ad10db9..3ec5ccb8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -301,6 +301,9 @@ (https://codeberg.org/dnkl/foot/issues/395). * Completions for Bash shell (https://codeberg.org/dnkl/foot/issues/10). +* Implement `XTVERSION` (`CSI > 0q`). Foot will reply with + `DCS>|foot(<major>.<minor>.<patch>)ST` + (https://codeberg.org/dnkl/foot/issues/359). ### Changed @@ -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; |
