diff options
| author | Craig Barnes <craigbarnes@protonmail.com> | 2024-03-15 17:51:51 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2024-03-16 14:36:00 +0000 |
| commit | 27330a5dd6d544acf80272e6173418d5e47d259b (patch) | |
| tree | afb1d7b61c06158dc12406de167c1318ad93e4f8 | |
| parent | sixel: disable debug logging (diff) | |
csi: indicate "permanently reset" for DECRQM queries of mode 67 (DECBKM)
This allows dynamic querying for the equivalent of terminfo's "kbs"
capability.
| -rw-r--r-- | CHANGELOG.md | 4 | ||||
| -rw-r--r-- | README.md | 6 | ||||
| -rw-r--r-- | csi.c | 8 |
3 files changed, 14 insertions, 4 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 04571604..53d0bf39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -64,14 +64,16 @@ * 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`). +* `DECRQM` queries for private mode 67 ([`DECBKM`]) now reply with mode + value 4 ("permanently reset") instead of 0 ("not recognized"). * Rectangular edit functions: `DECCARA`, `DECRARA`, `DECCRA`, `DECFRA` and `DECERA` ([#1633][1633]). * `Rect` capability to terminfo. [1348]: https://codeberg.org/dnkl/foot/issues/1348 [1633]: https://codeberg.org/dnkl/foot/issues/1633 - [1564]: https://codeberg.org/dnkl/foot/pulls/1564 +[`DECBKM`]: https://vt100.net/docs/vt510-rm/DECBKM.html ### Changed @@ -428,13 +428,13 @@ mode_, `\E[?1034l`), and enabled again with `smm` (_set meta mode_, ## Backspace Foot transmits DEL (`^?`) on <kbd>backspace</kbd>. This corresponds to -XTerm's `backarrowKey` option set to `false`, and to DECBKM being -_reset_. +XTerm's `backarrowKey` option set to `false`, and to +[`DECBKM`](https://vt100.net/docs/vt510-rm/DECBKM.html) being _reset_. To instead transmit BS (`^H`), press <kbd>ctrl</kbd>+<kbd>backspace</kbd>. -Note that foot does **not** implement DECBKM, and that the behavior +Note that foot does **not** implement `DECBKM`, and that the behavior described above **cannot** be changed. Finally, pressing <kbd>alt</kbd> will prefix the transmitted byte with @@ -324,6 +324,11 @@ decset_decrst(struct terminal *term, unsigned param, bool enable) term->keypad_keys_mode = enable ? KEYPAD_APPLICATION : KEYPAD_NUMERICAL; break; + case 67: + if (enable) + LOG_WARN("unimplemented: DECBKM"); + break; + case 80: term->sixel.scrolling = !enable; break; @@ -555,6 +560,7 @@ decrqm(const struct terminal *term, unsigned param) case 25: return decrpm(!term->hide_cursor); case 45: return decrpm(term->reverse_wrap); case 66: return decrpm(term->keypad_keys_mode == KEYPAD_APPLICATION); + case 67: return DECRPM_PERMANENTLY_RESET; /* https://vt100.net/docs/vt510-rm/DECBKM */ case 80: return decrpm(!term->sixel.scrolling); case 1000: return decrpm(term->mouse_tracking == MOUSE_CLICK); case 1001: return DECRPM_PERMANENTLY_RESET; @@ -600,6 +606,7 @@ xtsave(struct terminal *term, unsigned param) case 45: term->xtsave.reverse_wrap = term->reverse_wrap; break; case 47: term->xtsave.alt_screen = term->grid == &term->alt; break; case 66: term->xtsave.application_keypad_keys = term->keypad_keys_mode == KEYPAD_APPLICATION; break; + case 67: break; case 80: term->xtsave.sixel_display_mode = !term->sixel.scrolling; break; case 1000: term->xtsave.mouse_click = term->mouse_tracking == MOUSE_CLICK; break; case 1001: break; @@ -642,6 +649,7 @@ xtrestore(struct terminal *term, unsigned param) case 45: enable = term->xtsave.reverse_wrap; break; case 47: enable = term->xtsave.alt_screen; break; case 66: enable = term->xtsave.application_keypad_keys; break; + case 67: return; case 80: enable = term->xtsave.sixel_display_mode; break; case 1000: enable = term->xtsave.mouse_click; break; case 1001: return; |
