summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/replica.zig6
-rw-r--r--core/root.zig2
-rw-r--r--runtime/session.zig5
-rw-r--r--test/process.zig5
4 files changed, 14 insertions, 4 deletions
diff --git a/core/replica.zig b/core/replica.zig
index cbb64363..817d2c19 100644
--- a/core/replica.zig
+++ b/core/replica.zig
@@ -3257,6 +3257,12 @@ fn takeJoined(r: *Replica, j: *Joined, have: ?*Have, t0: u64) void {
// PARDES_REPLICA_STATS: its timing samples kept, for its line.
r.stats.samples = std.c.getenv("PARDES_REPLICA_STATS") != null;
r.gmtoff = j.gmtoff;
+ // PARDES_TERM_BYTES: its terminals its own emulators, fed the pty's
+ // bytes its units carry (a session started with it: Peers.bytes).
+ if (std.c.getenv("PARDES_TERM_BYTES") != null) {
+ r.t.screen_state = false;
+ r.core().echo = null;
+ }
// On the session's machine: a file read sent by hash is read here;
// far, it goes to the disk for the next join.
r.t.local_files = have == null;
diff --git a/core/root.zig b/core/root.zig
index 65f61e0d..8c325935 100644
--- a/core/root.zig
+++ b/core/root.zig
@@ -631,7 +631,7 @@ const machine_lines = [_]struct { []const u8, usize, []const u8 }{
.{ "jj.zig", 8, "jj run under tape.site(.jj) on an io of its own (the tape's spawns nothing) with this process's environment, the signal mask cleared as Stream's children's: the session's, a replica replays its answer" },
.{ "look.zig", 6, "openLink's fork (the host's: a view's frontend opens a link) and a remote's error name" },
.{ "memory.zig", 7, "the memory regions themselves (mmap, madvise, their locks)" },
- .{ "replica.zig", 75, "the client and session engines: sockets, threads, clocks, the blob cache, traces" },
+ .{ "replica.zig", 76, "the client and session engines: sockets, threads, clocks, the blob cache, traces" },
.{ "rollback.zig", 1, "a test helper's directory" },
.{ "root.zig", 4, "dev's modules re-exported (host_io, file_watch, glide, fonts)" },
.{ "selection_pipe.zig", 14, "a pipe's child processes and their files: the host's `pipe` entry" },
diff --git a/runtime/session.zig b/runtime/session.zig
index 75e8efcc..65432d97 100644
--- a/runtime/session.zig
+++ b/runtime/session.zig
@@ -86,7 +86,10 @@ pub fn Loop(comptime Frontend: type) type {
defer l.prompt_rcs.deinit();
l.fs = ninep_io.start(l.io, l.gpa, l.core);
defer if (l.fs) |f| f.deinit(l.gpa);
- l.peers = .{ .gpa = l.gpa, .io = l.io, .name = daemon.name() };
+ // PARDES_TERM_BYTES (a working name, the pair's corpus runs): its
+ // clients' terminals by the pty's bytes (Peers.bytes), as the
+ // soak's `--bytes`; its clients must be started with it too.
+ l.peers = .{ .gpa = l.gpa, .io = l.io, .name = daemon.name(), .bytes = std.c.getenv("PARDES_TERM_BYTES") != null };
l.inbox = .{ .io = l.io, .gpa = l.gpa, .lsp_allocator = l.allocs.lsp };
defer l.inbox.deinit();
// A search's worker may be waiting on the queue for room.
diff --git a/test/process.zig b/test/process.zig
index 791a5b8e..b16c50ff 100644
--- a/test/process.zig
+++ b/test/process.zig
@@ -945,8 +945,9 @@ pub const Child = struct {
while (environ[i]) |kv| {
const entry = std.mem.span(kv);
const eq = std.mem.indexOfScalar(u8, entry, '=') orelse entry.len;
- // 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) {
+ // PARDES_PAIR kept: the suite run as pairs (main.zig `pair`);
+ // PARDES_TERM_BYTES, their terminals by the pty's bytes.
+ if ((std.mem.startsWith(u8, entry, "PARDES_") and !std.mem.startsWith(u8, entry, "PARDES_PAIR=") and !std.mem.startsWith(u8, entry, "PARDES_TERM_BYTES=")) 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);