From 950a616e45f76349c3f029e6032cce7cadc2b4e3 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 27 Jul 2026 00:34:10 -0300 Subject: silence library std.log: ghostty-vt's unimplemented-sequence chatter was painting over the UI --- test/hxdiff.zig | 6 ++++++ test/snapshot.zig | 8 ++++++++ test/snapshots/logquiet.golden | 31 +++++++++++++++++++++++++++++++ test/snapshots/logquiet.snap | 16 ++++++++++++++++ 4 files changed, 61 insertions(+) create mode 100644 test/snapshots/logquiet.golden create mode 100644 test/snapshots/logquiet.snap (limited to 'test') diff --git a/test/hxdiff.zig b/test/hxdiff.zig index dc901263..b04cc0b5 100644 --- a/test/hxdiff.zig +++ b/test/hxdiff.zig @@ -49,6 +49,12 @@ const std = @import("std"); const libc = std.c; const pardes = @import("pardes"); +// Its own root, so src/main.zig's logFn does not apply here: the core it +// drives feeds every case's text through ghostty-vt, which narrates each +// sequence it does not implement. Cut the libraries back to errors; the +// per-case report goes through std.debug, so a mismatch stays loud. +pub const std_options: std.Options = .{ .log_level = .err }; + const gpa = std.heap.page_allocator; pub fn main(init: std.process.Init) !void { diff --git a/test/snapshot.zig b/test/snapshot.zig index 54ba0271..5417530d 100644 --- a/test/snapshot.zig +++ b/test/snapshot.zig @@ -32,6 +32,14 @@ const libc = std.c; const ghostty_vt = @import("ghostty-vt"); const eh = @import("e2e_harness.zig"); +// This harness parses the app's output with its OWN ghostty-vt, which narrates +// every sequence it does not implement — vaxis's startup capability probes +// alone cost four `debug(stream)`/`warning(stream)`/`debug(kitty_gfx)` lines +// per script, burying the PASS/FAIL report under 200 lines of chatter. Cut the +// libraries back to errors; the report itself goes through std.debug, so a +// failure stays loud either way. +pub const std_options: std.Options = .{ .log_level = .err }; + extern "c" fn setenv(name: [*:0]const u8, value: [*:0]const u8, overwrite: c_int) c_int; extern "c" fn execvp(file: [*:0]const u8, argv: [*:null]const ?[*:0]const u8) c_int; diff --git a/test/snapshots/logquiet.golden b/test/snapshots/logquiet.golden new file mode 100644 index 00000000..86b1567a --- /dev/null +++ b/test/snapshots/logquiet.golden @@ -0,0 +1,31 @@ +== snap quiet grid=100x30 cursor=62,4 +|Kill Newcol Tutor Debug Colors NextColor Crt Dump +| TTY /tmp/pardes-snap/logquiet/cwd Del +| $ ls +| $ printf '\033_Ga=q,i=1,s=1,v=1,f=24,t=d;AAAA\033\\\033[>0p' +| $ '\033_Ga=q,i=1,s=1,v=1,f=24,t=d;AAAA\033\\\033[>0p'Gi=1;OK +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| diff --git a/test/snapshots/logquiet.snap b/test/snapshots/logquiet.snap new file mode 100644 index 00000000..02d52495 --- /dev/null +++ b/test/snapshots/logquiet.snap @@ -0,0 +1,16 @@ +# ghostty-vt narrates every sequence it does not implement through std.log, +# and a pardes child's stderr is this pty — so a library log line lands on the +# rendered grid, exactly where it does on a real user's terminal. The two +# sequences below are the cheapest ones that trip it: a kitty graphics query +# (`debug(kitty_gfx): executing kitty graphics command`) and a private CSI p +# (`warning(stream): ignoring unimplemented CSI p with intermediates: >`). +# The golden is the assertion that neither reaches the screen. +start 30 100 -n 1 +wait 8000 Kill Newcol +stable 700 20000 +key c-b +stable 600 8000 +text printf '\033_Ga=q,i=1,s=1,v=1,f=24,t=d;AAAA\033\\\033[>0p' +key enter +stable 700 20000 +snap quiet -- cgit v1.3