28 Commits

Author SHA1 Message Date
Mitchell Hashimoto
853ba9e3c7 terminal: reset should preserve desired default mode values
Fixes #2857

Some terminal modes always reset, but there are others that should be
conditional based on how the terminal's default state is configured.
Primarily from #2857 is the grapheme clustering mode (mode 2027) which
was always resetting to false but should be conditional based on the
the `grapheme-width-method` configuration.
2024-11-29 14:42:01 -08:00
Mitchell Hashimoto
137ba66211 terminal: implement in-band size reports (Mode 2048)
https://gist.github.com/rockorager/e695fb2924d36b2bcf1fff4a3704bd83
2024-07-17 10:18:15 -07:00
Mitchell Hashimoto
b48d24a546 update zig 2024-03-13 09:14:12 -07:00
Mitchell Hashimoto
6fe8376073 terminal: support mode 2031 2024-02-02 13:08:10 -08:00
Mitchell Hashimoto
cba27e26cf input: manage application keypad state with mode 1035
Fixes #1099

We previously applied application keypad mode logic (`ESC=` or mode 66)
whenever it was active. However, from looking at the behavior of other
terminals (xterm and foot) it appears this isn't correct.

For xterm, application keypad mode only applies unconditionally if the
keyboard mode is VT220 (`-kt vt220`). For modern terminals, application
keypad mode is only applied if mode 1035 is disabled.

Mode 1035 is the "ignore numpad state with keypad mode" mode. It
defaults to true on terminal startup. If this is true, keypads are
always encoded in numerical mode. If this is false, the numlock state
will be respected.
2024-01-09 11:57:09 -08:00
Tristan Partin
d2813655e5 fix: update code to compile with 0.12.0-dev.2075+f5978181e 2024-01-08 20:08:10 -06:00
Tim Culverhouse
c9f2f806ec terminal: implement mode 1047 (alternate screen)
Implement handling of mode 1047, which enters the alternate screen. This
is not used often, typically applications will favor 1049 (enter alt
screen, save cursor, clear alt screen).
2023-12-05 10:37:11 -06:00
Mitchell Hashimoto
ec3b570b3e terminal: know about autorepeat mode
Ignore it because xterm does
2023-11-21 18:48:05 -08:00
Mitchell Hashimoto
3192b13546 terminal: our mode size changed 2023-11-12 22:20:28 -08:00
Mitchell Hashimoto
8783f6c925 xterm audit: slow scroll (DECSCLM) 2023-11-12 22:11:11 -08:00
Mitchell Hashimoto
880d7869a9 inspector: show modes 2023-10-24 15:27:16 -07:00
Mitchell Hashimoto
06f7cfb398 terminal: save cursor and restore cursor xterm audit 2023-10-15 21:25:47 -07:00
Mitchell Hashimoto
5ce50d08a1 terminal: linefeed mode 2023-10-12 20:46:26 -07:00
Mitchell Hashimoto
853c0427e6 website: document srm mode 2023-10-12 19:38:06 -07:00
Mitchell Hashimoto
6a065540dd terminal: KAM (mode 2)
This has an associated config `vt-kam-allowed` which defaults to "false"
since this mode can cause the terminal to become mostly unusable. We
include this mode for completions sake however.
2023-10-12 17:07:47 -07:00
Mitchell Hashimoto
0c2bf94b13 Enable left/right margin support 2023-10-10 15:21:45 -07:00
Mitchell Hashimoto
f216609662 terminal: RIS should reset tabstops, ESC ? W should reset every 8
Fixes #648

Two issues here:

  - RIS should've been resetting the tabstops to every 8, but was
    clearing all tabstops.

  - `ESC ? W` should've reset tabstops to every 8, but was clearing
    all tabstops.
2023-10-10 09:02:22 -07:00
Mitchell Hashimoto
2354454907 terminal: set left and right margins, left and right margin mode 69 2023-10-09 21:20:15 -07:00
Mitchell Hashimoto
9c45c6a3d1 terminal: handle ansi vs dec mode
Previously, we just ignored ansi vs dec modes (`?`-prefix) and just
responded to both requests most of the time using the number as the
unique value. This _kind of works_ because almost all DEC modes do not
overlap with ANSI modes, but some overlap (i.e. `insert`, ANSI mode 4).

This commit properly separates ANSI vs DEC modes and updates all of our
terminal sequences to handle both (where applicable -- some sequences
are explicitly DEC-only).
2023-10-09 16:01:08 -07:00
Mitchell Hashimoto
d0b8bf7752 terminal: enable alternate scroll mode by default
Fixes #641

xterm does not so there is an argument to not doing this but a lot of
other terminals do. Having this on by default makes things like less
scroll with the mouse wheel by default which is nice to have.
2023-10-09 09:23:39 -07:00
Mitchell Hashimoto
d85baa4631 terminal: alternate scroll (mode 1007) should not be enabled by default 2023-10-07 14:26:11 -07:00
Mitchell Hashimoto
9e506ac7e1 terminal: cursor back handles reverse wrap (mode 45) 2023-10-06 08:35:02 -07:00
Mitchell Hashimoto
7fe1a61ae8 terminal: cursor back should reduce count if pending wrap is one 2023-10-06 07:52:15 -07:00
Mitchell Hashimoto
5f96adb993 terminal: mode 2027 2023-10-02 09:34:43 -07:00
Mitchell Hashimoto
d9cfd00e9f Big Cursor State Refactor
This makes a few major changes:

  - cursor style on terminal is single source of stylistic truth
  - cursor style is split between style and style request
  - cursor blinking is handled by the renderer thread
  - cursor style/visibility is no longer stored as persistent state on
    renderers
  - cursor style computation is extracted to be shared by all renderers
  - mode 12 "cursor_blinking" is now source of truth on whether blinking
    is enabled or not
  - CSI q and mode 12 are synced like xterm
2023-09-09 20:19:37 -07:00
Mitchell Hashimoto
2cc1e43716 termio: handle all the synchronized output setting, timer 2023-08-28 11:35:40 -07:00
Mitchell Hashimoto
716c343f07 terminal: ModeState can save/restore one set of modes 2023-08-15 08:43:25 -07:00
Mitchell Hashimoto
e467a48df0 terminal: working on new modes storage abstraction 2023-08-15 08:43:24 -07:00