698 Commits

Author SHA1 Message Date
Mitchell Hashimoto
254365afab terminal: add sanitize.zig 2023-11-04 11:25:02 -07:00
Mitchell Hashimoto
a38220eade terminal: move sanitization check to this package, unit test 2023-11-04 11:19:25 -07:00
Chinmay Dalal
481af8039b disable zig fmt for aligned comments 2023-10-31 23:08:51 +05:30
Chinmay Dalal
bccf1216bc exit early when cursor is on a prompt line 2023-10-30 12:42:58 +05:30
Chinmay Dalal
0920ab08cd handle cursor on a prompt line 2023-10-30 11:52:35 +05:30
Chinmay Dalal
3ff20c7418 add tests 2023-10-30 10:19:21 +05:30
Chinmay Dalal
fae356be5a implement selecting output a ScreenPoint is in
This works by finding prompt markers provided by shell integration
Does not yet close #752 as this is not exposed
2023-10-30 01:30:43 +05:30
Mitchell Hashimoto
069e16cb46 terminal: restore cursor should clamp x/y 2023-10-27 09:42:39 -07:00
Mitchell Hashimoto
306689b8a4 terminal: sgr direct bg also had wrong slice len 2023-10-27 09:27:45 -07:00
Mitchell Hashimoto
d28e6739c7 terminal: sgr direct color fg missing color doesn't crash 2023-10-27 09:25:16 -07:00
Mitchell Hashimoto
0b6cbfa141 terminal: only clear spacer tail if exists 2023-10-27 09:14:53 -07:00
Mitchell Hashimoto
4c45bfec9e terminal: improve some debug logging 2023-10-27 09:14:29 -07:00
Mitchell Hashimoto
597f95120b terminal: ECH minimum count is 1 2023-10-27 08:50:05 -07:00
Mitchell Hashimoto
3a77df7ce2 terminal: in mode 2027, do not attach any width=0 char unless grapheme 2023-10-27 08:23:43 -07:00
Mitchell Hashimoto
578dd730f9 terminal: CUB with reverse wrap on first row should not crash 2023-10-26 23:01:55 -07:00
Mitchell Hashimoto
ea1ef0641d terminal: assertion should check x is on left margin 2023-10-26 22:52:12 -07:00
Mitchell Hashimoto
9c165ecbd2 terminal: clamp cursor left above scroll region with XTREVWRAP2
Fixes a crash found through fuzzing. This crash is also exhibited in
xterm (as of v384). The issue arises when you set the cursor above the top
scroll margin, then issue a large cursor left (CSI D) with extended reverse
wrap (?1045) set. Extended reverse wrap loops back until it reaches the top
scroll then wraps around. But since the cursor is before the top scroll,
xterm just arbitrarily moves back into negative row numbers, which reads into
bad memory.

We decided to fix this by clamping to (0,0) and exiting because this
will mimic the xterm behavior for valid values of cursor left count
(prior to crashing).
2023-10-26 22:38:33 -07:00
Mitchell Hashimoto
28aace4393 Merge pull request #728 from mitchellh/cimgui
Terminal Inspector v1
2023-10-26 10:12:39 -07:00
Mitchell Hashimoto
0baf3522b4 terminal: bring back unimplemented logs 2023-10-26 09:53:57 -07:00
Mitchell Hashimoto
99591f280b terminal: addWithOverflow to detect max int 2023-10-26 09:50:29 -07:00
Nameless
49f1866f28 add tests for fuzzed results, clean up unimplemented osc warning 2023-10-25 11:44:16 -05:00
Nameless
81f7ae63b0 fuzz: src/terminal/stream.zig
osc.zig: undefined pointer was dereferenced when warning was issued
for handler missing
Parser.zig: too many parameters was not handled in the final case
Parser.zig: parameters being too long (>255 digits) was not handled
2023-10-25 11:42:13 -05:00
Mitchell Hashimoto
c1469eb7b2 inspector: track lots of metadata for vt events 2023-10-24 21:56:38 -07:00
Mitchell Hashimoto
ccb1cea49a inspector: filter terminal io events by kind 2023-10-24 20:55:29 -07:00
Mitchell Hashimoto
7b2af3a039 inspector: start termio log 2023-10-24 15:27:17 -07:00
Mitchell Hashimoto
4ed6112e6d move circular buffer to src/ 2023-10-24 15:27:16 -07:00
Mitchell Hashimoto
41dbbf43d2 terminal: circular buffer has append, clear, iterator 2023-10-24 15:27:16 -07:00
Mitchell Hashimoto
880d7869a9 inspector: show modes 2023-10-24 15:27:16 -07:00
Mitchell Hashimoto
aee05d9e99 terminal: deleteLines has to reset wrap state on blank lines 2023-10-24 12:50:06 -07:00
Mitchell Hashimoto
66d97ab5f3 terminal: do not attach grapheme to empty cell 2023-10-24 12:20:37 -07:00
Mitchell Hashimoto
1457bcec90 terminal: deleteCharacters should clear wide spacer tails if split 2023-10-24 12:10:41 -07:00
Mitchell Hashimoto
62475fd709 terminal: ICH should only run with no intermediates 2023-10-24 09:43:06 -07:00
Mitchell Hashimoto
ec26cc4b41 terminal: insert blanks (ICH) with left/right and large count 2023-10-24 09:38:47 -07:00
Mitchell Hashimoto
e6a23be99a terminal: cub with reverse mode on left margin 2023-10-24 09:26:34 -07:00
Mitchell Hashimoto
96d5ca3604 terminal: horizontal tab back should handle cursor already left margin 2023-10-24 08:45:07 -07:00
Mitchell Hashimoto
407bd6fb79 terminal: with mode 2027, vs16 must move cursor one more right
Fixes #680
2023-10-16 09:48:05 -07:00
Mitchell Hashimoto
12054087e1 terminal: scroll up full top/bottom region was off by one
Fixes #689

See test cases, verified with xterm.
2023-10-16 09:25:47 -07:00
Mitchell Hashimoto
06f7cfb398 terminal: save cursor and restore cursor xterm audit 2023-10-15 21:25:47 -07:00
Mitchell Hashimoto
de1ed071ad termio: configure OSC parser with an allocator 2023-10-15 08:41:38 -07:00
Mitchell Hashimoto
cfac6c4001 terminal: OSC parser takes optional allocator
OSC 52 is the only command that uses this today. If the allocator is
present it will use it to store the clipboard contents.
2023-10-14 21:49:10 -07:00
Mitchell Hashimoto
59140f593b terminal: VS16 should make a narrow char take up two cells in mode 2027 2023-10-14 10:43:50 -07:00
Mitchell Hashimoto
529d1f016f terminal: when clearing previous wide character, preserve SGR state 2023-10-13 15:15:14 -07:00
Mitchell Hashimoto
880252fd1d terminal: printing over wide spacer tail should clear wide char 2023-10-13 14:45:40 -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
89d2827910 terminal: insert mode tests, fix insertBlanks multi-cell char split 2023-10-12 19:24:27 -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
17430a1250 terminal: index handles left/right regions 2023-10-12 08:31:28 -07:00
Mitchell Hashimoto
f94f32be79 website 2023-10-11 22:01:37 -07:00
Mitchell Hashimoto
392da475e1 terminal: XTSHIFTESCAPE 2023-10-11 21:49:04 -07:00