mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-13 04:27:47 -05:00
csi: add support for DECNKM private mode
This is equivalent to DECKPAM/DECKPNM when enabled/disabled, but can also be saved/restored/queried with XTSAVE/XTRESTORE/DECRQM. See also: * https://vt100.net/docs/vt510-rm/DECNKM.html * https://vt100.net/docs/vt510-rm/DECKPAM.html * https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-PC-Style-Function-Keys
This commit is contained in:
parent
a1287220ab
commit
8d4d22218e
4 changed files with 17 additions and 0 deletions
|
|
@ -45,6 +45,8 @@
|
|||
* Add "xterm" as fallback cursor where "text" is not available.
|
||||
* `[key-bindings].scrollback-home|end` options.
|
||||
* Socket activation for `foot --server` and accompanying systemd unit files
|
||||
* Support for [DECNKM](https://vt100.net/docs/vt510-rm/DECNKM.html), which
|
||||
allows setting/saving/restoring/querying the keypad mode.
|
||||
|
||||
|
||||
### Changed
|
||||
|
|
@ -88,8 +90,11 @@
|
|||
|
||||
|
||||
### Security
|
||||
|
||||
### Contributors
|
||||
|
||||
* Craig Barnes
|
||||
|
||||
|
||||
## 1.11.0
|
||||
|
||||
|
|
|
|||
8
csi.c
8
csi.c
|
|
@ -393,6 +393,11 @@ decset_decrst(struct terminal *term, unsigned param, bool enable)
|
|||
term->reverse_wrap = enable;
|
||||
break;
|
||||
|
||||
case 66:
|
||||
/* DECNKM */
|
||||
term->keypad_keys_mode = enable ? KEYPAD_APPLICATION : KEYPAD_NUMERICAL;
|
||||
break;
|
||||
|
||||
case 80:
|
||||
term->sixel.scrolling = !enable;
|
||||
break;
|
||||
|
|
@ -603,6 +608,7 @@ decrqm(const struct terminal *term, unsigned param, bool *enabled)
|
|||
case 12: *enabled = term->cursor_blink.decset; return true;
|
||||
case 25: *enabled = !term->hide_cursor; return true;
|
||||
case 45: *enabled = term->reverse_wrap; return true;
|
||||
case 66: *enabled = term->keypad_keys_mode == KEYPAD_APPLICATION; return true;
|
||||
case 80: *enabled = !term->sixel.scrolling; return true;
|
||||
case 1000: *enabled = term->mouse_tracking == MOUSE_CLICK; return true;
|
||||
case 1001: *enabled = false; return true;
|
||||
|
|
@ -646,6 +652,7 @@ xtsave(struct terminal *term, unsigned param)
|
|||
case 25: term->xtsave.show_cursor = !term->hide_cursor; break;
|
||||
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 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;
|
||||
|
|
@ -688,6 +695,7 @@ xtrestore(struct terminal *term, unsigned param)
|
|||
case 25: enable = term->xtsave.show_cursor; break;
|
||||
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 80: enable = term->xtsave.sixel_display_mode; break;
|
||||
case 1000: enable = term->xtsave.mouse_click; break;
|
||||
case 1001: return;
|
||||
|
|
|
|||
|
|
@ -268,6 +268,9 @@ that corresponds to one of the following modes:
|
|||
| 47
|
||||
: xterm
|
||||
: Same as 1047 (see below)
|
||||
| 66
|
||||
: VT320
|
||||
: Numeric keypad mode (DECNKM); same as DECKPAM/DECKPNM when enabled/disabled
|
||||
| 1000
|
||||
: xterm
|
||||
: Send mouse x/y on button press/release
|
||||
|
|
|
|||
|
|
@ -393,6 +393,7 @@ struct terminal {
|
|||
struct {
|
||||
bool origin:1;
|
||||
bool application_cursor_keys:1;
|
||||
bool application_keypad_keys:1;
|
||||
bool reverse:1;
|
||||
bool show_cursor:1;
|
||||
bool reverse_wrap:1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue