From 32ac0d9d5f7de60f2045edbd1c15631306bd25d4 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 20 Nov 2026 04:50:25 -0300 Subject: pair: PARDES_PAIR (a working name, one variable) makes `pardes FILE` in a terminal a session and its first client over a socket pair (the last step's design 1.1, Z1): the daemon dialled first as for a stub, the terminal's size read, a fork; the parent is the client (the shell's job, the terminal its own, so WINCH/HUP/TERM reach what draws), its first join on its end of the pair (runtime/main.zig `pair`, tui.runClient unchanged); the child is the session (setsid, 0/1/2 on /dev/null, detached, registered on the dialled connection), its end taken as its first client before its first effects (the previous change); with no daemon too, where a pair's session ends with its last link (runtime/session.zig); without the variable nothing changes (tui core-test 856/1009, shell-test 1049/1052, term 17/17, pane 183/184, kitty 45/45, behaviour 275/275 and --replay, process-test 0 of 144 but pagercolor, which passed alone, both soaks diverged 0 unequal 0 corpus 22 of 22, the bytes soak's one unlisted stop now:1 the base's; daemon.py plain, far, games, upgrade both ways pass); test/daemon.py `pair` (and --pair): the job, the session its child in a session of its own, listed with its client, drawn, typed, digests agreed, Exit ends both, with no daemon a client killed outright ends its session, nothing left; process-test with the variable: 17 of 144 fail as pairs (the harness dials the launched pid's socket, its goldens are an own frontend's frames, a Restore lets the client go with no daemon to rejoin through, its signal and no-terminal cases are the own path's), and one daemon-on case leaves its pair session running (a killed client is a loss: Z4's harness), test/process.zig passes PARDES_PAIR through for that run Co-Authored-By: Claude Opus Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- test/process.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test/process.zig') diff --git a/test/process.zig b/test/process.zig index 8bcbddeb..e2a4f592 100644 --- a/test/process.zig +++ b/test/process.zig @@ -916,7 +916,8 @@ pub const Child = struct { while (environ[i]) |kv| { const entry = std.mem.span(kv); const eq = std.mem.indexOfScalar(u8, entry, '=') orelse entry.len; - if (std.mem.startsWith(u8, entry, "PARDES_") or std.mem.indexOf(u8, entry[0..eq], "PAGER") != null) { + // PARDES_PAIR kept: the suite run as pairs (main.zig `pair`). + if ((std.mem.startsWith(u8, entry, "PARDES_") and !std.mem.startsWith(u8, entry, "PARDES_PAIR=")) or std.mem.indexOf(u8, entry[0..eq], "PAGER") != null) { var name: [256]u8 = undefined; const n = std.fmt.bufPrintSentinel(&name, "{s}", .{entry[0..@min(eq, 255)]}, 0) catch _exit(126); _ = unsetenv(n); -- cgit v1.3