mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-08 08:20:59 -04:00
csi: recognize DECRQM (CSI ? Ps $ p)
The client sends this to request the state of DEC private modes. We don't support any of them, so for now, reply with 'reset'.
This commit is contained in:
parent
b583e63bba
commit
7472e9c152
1 changed files with 23 additions and 0 deletions
23
csi.c
23
csi.c
|
|
@ -822,6 +822,29 @@ csi_dispatch(struct terminal *term, uint8_t final)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case 'p': {
|
||||||
|
if (term->vt.private[1] != '$') {
|
||||||
|
LOG_ERR("unimplemented: %s", csi_as_string(term, final));
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned param = vt_param_get(term, 0, 0);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Request DEC private mode (DECRQM)
|
||||||
|
* Reply:
|
||||||
|
* 0 - not recognized
|
||||||
|
* 1 - set
|
||||||
|
* 2 - reset
|
||||||
|
* 3 - permanently set
|
||||||
|
* 4 - permantently reset
|
||||||
|
*/
|
||||||
|
char reply[32];
|
||||||
|
snprintf(reply, sizeof(reply), "\033[?%u;2$y", param);
|
||||||
|
vt_to_slave(term, reply, strlen(reply));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case 's':
|
case 's':
|
||||||
for (size_t i = 0; i < term->vt.params.idx; i++) {
|
for (size_t i = 0; i < term->vt.params.idx; i++) {
|
||||||
switch (term->vt.params.v[i].value) {
|
switch (term->vt.params.v[i].value) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue