diff options
| -rw-r--r-- | CHANGELOG.md | 1 | ||||
| -rw-r--r-- | csi.c | 17 | ||||
| -rw-r--r-- | doc/foot-ctlseqs.7.scd | 17 |
3 files changed, 30 insertions, 5 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index b2e4a62d..a11e2b5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,6 +61,7 @@ * `pipe-command-output` key binding. * Support for OSC-176, _"Set App-ID"_ (https://gist.github.com/delthas/d451e2cc1573bb2364839849c7117239). +* Support for `DECRQM` queries with ANSI/ECMA-48 modes (`CSI Ps $ p`). [1348]: https://codeberg.org/dnkl/foot/issues/1348 @@ -1429,6 +1429,23 @@ csi_dispatch(struct terminal *term, uint8_t final) break; } + case 'p': { + /* + * Request status of ECMA-48/"ANSI" private mode (DECRQM + * for SM/RM modes; see private="?$" case further below for + * DECSET/DECRST modes) + */ + unsigned param = vt_param_get(term, 0, 0); + unsigned status = DECRPM_NOT_RECOGNIZED; + if (param == 4) { + status = decrpm(term->insert_mode); + } + char reply[32]; + size_t n = xsnprintf(reply, sizeof(reply), "\033[%u;%u$y", param, status); + term_to_slave(term, reply, n); + break; + } + case 'u': { enum kitty_kbd_flags flags = term->grid->kitty_kbd.flags[term->grid->kitty_kbd.idx]; diff --git a/doc/foot-ctlseqs.7.scd b/doc/foot-ctlseqs.7.scd index 64c56d5d..0d8d5d79 100644 --- a/doc/foot-ctlseqs.7.scd +++ b/doc/foot-ctlseqs.7.scd @@ -443,13 +443,13 @@ manipulation sequences. The generic format is: | \\E[ _Pm_ h : SM : VT100 -: Set mode. _Pm_=4 -> enable IRM (insert mode). All other values of - _Pm_ are unsupported. +: Set mode. _Pm_=4 -> enable IRM (Insertion Replacement Mode). All + other values of _Pm_ are unsupported. | \\E[ _Pm_ l : RM : VT100 -: Reset mode. _Pm_=4 -> disable IRM (insert mode). All other values of - _Pm_ are unsupported. +: Reset mode. _Pm_=4 -> disable IRM (Insertion Replacement Mode). All + other values of _Pm_ are unsupported. | \\E[ _Ps_ n : DSR : VT100 @@ -487,7 +487,14 @@ manipulation sequences. The generic format is: | \\E[ ? _Ps_ $ p : DECRQM : VT320 -: Request DEC private mode. +: Request status of DEC private mode. The _Ps_ parameter corresponds + to one of the values mentioned in the "Private Modes" section above + (as set with DECSET/DECRST). +| \\E[ _Ps_ $ p +: DECRQM +: VT320 +: Request status of ECMA-48/ANSI mode. See the descriptions for SM/RM + above for recognized _Ps_ values. | \\E[ _Ps_ T : SD : VT420 |
