From 2ab8acae32ea4f1a0988f2f1f0841f7e7ac99e93 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 16 Nov 2026 23:15:45 -0300 Subject: pager: a +Pager reads its program's output with its own parser, so pager.zig stops importing ghostty-vt: ECMA-48's states as ghostty-vt's table has them (C0 acted on in an escape or a CSI, dropped in a string, the C1 bytes' transitions outside an OSC's and a DCS's data, CAN and SUB), UTF-8 with each ill-formed part one U+FFFD and a sequence the input ends inside not printed, a CSI's parameters at ghostty's limits (24, saturating, colons only for SGR), and SGR read as its sgr.Parser reads it (colon colours with and without a colour space, 38;5 short of its index, unknown colon lists skipped, 58 consumed); CNL and CPL's return, CHT and REP as before; the Handler's printing, spans and overstrike are unchanged and still take a run of code points at a time; against the ghostty-driven parse, 400,040 pages (39 fixed: the tests' 17 inputs and 22 malformed, truncated and 8-bit cases; 400,000 random pages of escapes, parameters, controls, C1 bytes and UTF-8 fragments, a 3,000-line coloured log) came out with the same text and spans, in a test run once then removed; a 32 MiB coloured log parses in 1,997M instructions against 2,049M (98.6 ms against 110.3 ms, ReleaseFast), its printable ASCII going straight into the run; test: the less common forms, pinned (colon colours, 0x9b as a stray byte, CSI and UTF-8 C1, REP, CHT, CNL, 38;5 alone, UTF-8 cut short); the changelog says so --- src/ninep/ctl.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ninep/ctl.zig') diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig index 699b7833..a72e7259 100644 --- a/src/ninep/ctl.zig +++ b/src/ninep/ctl.zig @@ -699,7 +699,7 @@ pub fn writePager(p: *Pardes, req: Req) Reply { /// The text a /pager open wrote after its directory (`held`), a program's /// output for a terminal, put in the +Pager `serial` as `pardes -` once -/// wrote it to the body: through ghostty-vt (pager.zig), its colours kept +/// wrote it to the body: through pager.zig's parse, its colours kept /// as the pane's spans, one undo step, and left /// clean. Reads of the pane are its plain text. The held bytes go either way. pub fn fillPager(p: *Pardes, serial: u32, held: *std.ArrayList(u8)) error{OutOfMemory}!void { -- cgit v1.3