mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-13 05:33:51 -04:00
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
This commit is contained in:
parent
efd023ad32
commit
3adc3367e6
2 changed files with 19 additions and 0 deletions
16
csi.c
16
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue