mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-26 07:57:59 -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
|
|
@ -301,6 +301,9 @@
|
||||||
(https://codeberg.org/dnkl/foot/issues/395).
|
(https://codeberg.org/dnkl/foot/issues/395).
|
||||||
* Completions for Bash shell
|
* Completions for Bash shell
|
||||||
(https://codeberg.org/dnkl/foot/issues/10).
|
(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
|
### Changed
|
||||||
|
|
|
||||||
16
csi.c
16
csi.c
|
|
@ -1565,6 +1565,22 @@ csi_dispatch(struct terminal *term, uint8_t final)
|
||||||
}
|
}
|
||||||
break; /* final == 'm' */
|
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:
|
default:
|
||||||
UNHANDLED();
|
UNHANDLED();
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue