diff options
| author | Gabriel Schneider <[email protected]> | 2026-08-18 15:13:50 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-08-18 23:45:54 -0300 |
| commit | 58aae9a1f7aca8e64814c8775b0c17bf93f4da0f (patch) | |
| tree | 098a5afec048efc2b99871a1136ae32ab4a29fdc /test/e2e_harness.zig | |
| parent | 382abe3dafb872b3e6c9792a9cc0abcf6267e180 (diff) | |
| download | pardes-58aae9a1f7aca8e64814c8775b0c17bf93f4da0f.tar.gz pardes-58aae9a1f7aca8e64814c8775b0c17bf93f4da0f.zip | |
nested + pardes: snapshot updates and small behavior fixes across panes
Diffstat (limited to 'test/e2e_harness.zig')
| -rw-r--r-- | test/e2e_harness.zig | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/e2e_harness.zig b/test/e2e_harness.zig index 4767871f..6f2f5ef1 100644 --- a/test/e2e_harness.zig +++ b/test/e2e_harness.zig @@ -14,6 +14,7 @@ extern "c" fn forkpty( ) c_int; extern "c" fn execvp(file: [*:0]const u8, argv: [*:null]const ?[*:0]const u8) c_int; extern "c" fn _exit(status: c_int) noreturn; +extern "c" fn setenv(name: [*:0]const u8, value: [*:0]const u8, overwrite: c_int) c_int; /// Monotonic milliseconds; the harness's only clock (std.time lost /// milliTimestamp in 0.16). @@ -87,6 +88,14 @@ pub const Harness = struct { argv[0] = exe; for (args, 0..) |a, i| argv[i + 1] = a; + // The app under test is a fresh outer session even when this harness + // itself is running in a pardes pane. Unlike --nested, the boundary + // still lets pane shells below that app detect and talk to it, which + // nested.snap exercises directly. + var boundary_buf: [32:0]u8 = undefined; + const boundary = try std.fmt.bufPrintSentinel(&boundary_buf, "{d}", .{@as(u32, @intCast(libc.getpid()))}, 0); + if (setenv("PARDES_NESTED_BOUNDARY_PID", boundary, 1) != 0) return error.SetEnvFailed; + var master: c_int = undefined; const ws = posix.winsize{ .row = rows, .col = cols, .xpixel = 0, .ypixel = 0 }; const pid = forkpty(&master, null, null, &ws); |
