45 Commits

Author SHA1 Message Date
Qwerasd
f8c544c119 terminal: stream/parser changes 2024-02-07 19:08:34 -05:00
Qwerasd
cd570890f6 remove commented out test 2024-02-05 23:32:47 -05:00
Qwerasd
846b3421e6 terminal: replace utf8 decoding with custom decoder in stream.zig
(Completely removed utf8 handling from Parser.zig)
2024-02-05 23:20:47 -05:00
Mitchell Hashimoto
adb7958f61 remove tracy usage from all files 2024-01-13 15:06:08 -08:00
Gregory Anders
171292a063 core: implement OSC 12 and OSC 112 to query/set/reset cursor color 2023-11-09 16:21:07 -06:00
Mitchell Hashimoto
4c45bfec9e terminal: improve some debug logging 2023-10-27 09:14:29 -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
99591f280b terminal: addWithOverflow to detect max int 2023-10-26 09:50:29 -07: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
ccb1cea49a inspector: filter terminal io events by kind 2023-10-24 20:55:29 -07:00
Mitchell Hashimoto
de1ed071ad termio: configure OSC parser with an allocator 2023-10-15 08:41:38 -07:00
Mitchell Hashimoto
032fcee9ff terminal: DCS handler, XTGETTCAP parsing 2023-09-27 12:07:31 -07:00
Mitchell Hashimoto
063a66ea6c terminal: allow mixed semicolon/colon CSI m commands
Fixes #487
2023-09-18 21:45:19 -07:00
cryptocode
dc14ca86ca Review updates:
* Change state names to more human readable query_default_fg/bg
* Single-line state prongs
* String terminator is not an enum
* Removed `endWithStringTerminator` and added nullabe arg to `end`
* Fixed a color reporting bug, fg/bg wasn't correctly picked
2023-09-14 21:46:23 +02:00
cryptocode
a3696a9185 Implement OSC 10 and OSC 11 default color queries
These OSC commands report the default foreground and background colors.

Most terminals return the RGB components scaled up to 16-bit components, because some
legacy software are unable to read 8-bit components. The PR follows this conventions.

iTerm2 allow 8-bit reporting through a config option, and a similar option is
added here. In addition to picking between scaled and unscaled reporting, the user
can also turn off OSC 10/11 replies altogether.

Scaling is essentially c / 1 * 65535, where c is the 8-bit component, and reporting
is left-padded with zeros if necessary. This format appears to stem from the XParseColor
format.
2023-09-14 21:41:40 +02:00
Mitchell Hashimoto
24af24a086 terminal: CSI q requires a space intermediate 2023-09-10 22:01:17 -07:00
Mitchell Hashimoto
cbfa22555e terminal: test to ensure that DECRQM can parse 2023-08-28 08:36:00 -07:00
Mitchell Hashimoto
29e3e79b94 terminal: parse APC strings 2023-08-20 22:03:19 -07:00
Kevin Hovsäter
22b8173164 Fix typos 2023-08-08 14:27:34 +02:00
Mitchell Hashimoto
314f9287b1 Update Zig (#164)
* update zig

* pkg/fontconfig: clean up @as

* pkg/freetype,harfbuzz: clean up @as

* pkg/imgui: clean up @as

* pkg/macos: clean up @as

* pkg/pixman,utf8proc: clean up @as

* clean up @as

* lots more @as cleanup

* undo flatpak changes

* clean up @as
2023-06-30 12:15:31 -07:00
Mitchell Hashimoto
56f8e39e5b Update zig, mach, fmt 2023-06-25 11:08:20 -07:00
Mitchell Hashimoto
60d4024d64 terminal: reset CSI param separator in parser on clear 2023-06-24 15:16:54 -07:00
Mitchell Hashimoto
97df179b04 terminfo: switch to semicolon SGR 48 to prevent render issues 2023-06-24 15:04:33 -07:00
Mitchell Hashimoto
28a22fc07f various tests to ensure we parse curly underlines correctly 2023-06-20 09:24:07 -07:00
Mitchell Hashimoto
01c053d7fc terminal: parser must reset intermediate storage for utf8 2023-03-24 14:47:03 -07:00
Mitchell Hashimoto
38cd496c82 terminal: add missing anywhere states to ground, get rid of real state 2023-03-17 13:46:59 -07:00
Mitchell Hashimoto
df52fae76a terminal: check OSC parser for tmux 112 sequences from HN
Saw this on HN:
https://github.com/darrenstarr/VtNetCore/pull/14

I wanted to see if ghostty was vulnerable to it (it is not). But, its a
good example of a weird edge case in the wild and I wanted to make sure
it was redundantly tested. It looks like we read the "spec" (blog posts,
man pages, source of other terminal using tools, etc.) right.
2023-01-17 21:47:38 -08:00
Mitchell Hashimoto
4a3e2b35b9 terminal: parse table needs to have room for all chars 2022-12-14 21:10:22 -08:00
Mitchell Hashimoto
d7fe6a1c47 fix sgr parsing for underline styles 2022-11-27 15:30:02 -08:00
Mitchell Hashimoto
56de5846f4 OSC 52: Clipboard Control (#52)
This adds support for OSC 52 -- applications can read/write the clipboard. Due to the security risk of this, the default configuration allows for writing but _not reading_. This is configurable using two new settings: `clipboard-read` and `clipboard-write` (both booleans).
2022-11-21 15:12:00 -08:00
Mitchell Hashimoto
30a14d230e process ASCII events manually to avoid function call overhead 2022-09-01 17:53:40 -07:00
Mitchell Hashimoto
6369f1f2f9 big improvements in action logging 2022-07-24 09:20:02 -07:00
Mitchell Hashimoto
4a9b8ea187 add a formatter for CSI logs so that they're more easy to read 2022-07-23 18:13:37 -07:00
Mitchell Hashimoto
421a1c3039 invalid utf8 turns into � 2022-05-16 09:34:34 -07:00
Mitchell Hashimoto
ead4cec159 terminal: utf-8 decoding 2022-05-16 09:31:07 -07:00
Mitchell Hashimoto
21be62f780 terminal parser allows colons for SGR 2022-05-11 21:20:04 -07:00
Mitchell Hashimoto
daa0368319 parse DCS sequences (but do nothing) 2022-05-10 14:09:24 -07:00
Mitchell Hashimoto
bb4332ac38 terminal: OSC parser 2022-05-10 09:27:29 -07:00
Mitchell Hashimoto
c0c034af68 terminal: collect intermediates properly 2022-05-09 12:55:09 -07:00
Mitchell Hashimoto
86ab28cf10 esc dispatch is handled in parser 2022-05-08 20:52:15 -07:00
Mitchell Hashimoto
fd0fa1d08b implement erase line (EL) CSI 2022-05-08 20:20:21 -07:00
Mitchell Hashimoto
8e907a3522 terminal: pass intermediates through to CSI, ignore NUL 2022-05-08 15:02:24 -07:00
Mitchell Hashimoto
468f6e2b51 implement basic CSI dispatch action 2022-05-08 14:44:47 -07:00
Mitchell Hashimoto
20f9ad3f55 implement basic VT parser -- only print/execute handled 2022-04-18 11:01:47 -07:00
Mitchell Hashimoto
8d389b4ea9 initial VT emulation table 2022-04-18 09:38:52 -07:00