summaryrefslogtreecommitdiff
path: root/dev
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-21 11:09:42 -0300
committerGabriel Schneider <[email protected]>2026-11-21 12:42:33 -0300
commit9f4b8e83ed908c8b7a9bf979a5c9bf581e66c052 (patch)
tree188719afb0be2300c5e08042a6f2197b579ca49e /dev
parentc4f7bb9477c7aa4c8864f14edb9e85b6c8c08437 (diff)
downloadpardes-9f4b8e83ed908c8b7a9bf979a5c9bf581e66c052.tar.gz
pardes-9f4b8e83ed908c8b7a9bf979a5c9bf581e66c052.zip
pair: the process suite as pairs from 8 of 145 failing to 0, no golden changed: a pair's first client takes the session's view instead of one opened beside it (core/replica.zig `Peers.viewFor` `own`, daemon.zig `Joining.own`, `Replica.initBoot` alike so the digests agree), as does a joiner of any session with no frontend, no client and no view kept for one (after a Restore's `views.only`, or detached since): the boot's terminals were sized by the session's own view 0, which nobody looks at, so a client's layout never resized them (`Pardes.sizes`): the `↑` pans and the pane a row off of shrinktag, windowops, layout-close, topbarexec, headersweep-restored; a size already taken is no resize (dev/tui/tui.zig `Shell.resized`: a client's start and its input thread's first size were two `.resize` events, `resizes=2`); a Restore tells its clients so and they join again saying nothing (`Peers.restoring`, `restore_words`, `Link.rejoins`: they were cut with no word and asked the daemon, which once in two answered nothing listed and the client ended, and when they rejoined they said "upgrading"), a client handed over while it restores joins the restored core at the next boundary (it was hung up on, and its redial's 100 ms showed the old screen), and the dump's messages are not put on the clock while they rejoin (runtime/session.zig `restore`: the "Dump" chip went); a pair's client enters its terminal before its own boot (tui.zig `runClient`: keys typed while it booted went into a cooked terminal, echoed as ^B and lost; winch as a pair pinned to one CPU 0 of 5, now 5 of 5; the own path takes them); the tty cases' private daemon and their pair's session are killed at the case's end (test/tty.zig `Tty.deinit`: 21 of them outlived this morning's runs); core-test 894/1054 (160 skipped), shell-test 1096/1099 (3 skipped) (+1 each, the Restore's test; firstOnPair now expects no reload at a pair's first join); PARDES_PAIR=1 process-test 1, 0, 0 of 145 (pagercolor once at load 12.9, on the known list; runs 2 and 3 with no case failing even once), own path 0 of 145, winch alone as a pair 20 of 20; daemon.py plain, --pair, --attach-upgrading pass on Debug and ReleaseSafe
Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'dev')
-rw-r--r--dev/host_io.zig2
-rw-r--r--dev/tui/tui.zig22
2 files changed, 18 insertions, 6 deletions
diff --git a/dev/host_io.zig b/dev/host_io.zig
index a22bf5ce..419c4570 100644
--- a/dev/host_io.zig
+++ b/dev/host_io.zig
@@ -52,7 +52,7 @@ pub fn stopWorkers() void {
/// session is one view, the live one's (the tty's terminal, the window's
/// window): the others are let go, as a detach of each.
pub fn restoreCore(gpa: std.mem.Allocator, core: *pardes.Pardes, path: []const u8, peers: *replica.Peers, inotify_fd: c_int, watches: *file_watch.Table) ?*pardes.Pardes {
- peers.dropAll(core);
+ peers.restoring(core);
const bytes = pardes.dump.restoreBytes(core, gpa, path) catch |err| {
core.reportError(.at(core.view().active), "Restore", err);
return null;
diff --git a/dev/tui/tui.zig b/dev/tui/tui.zig
index 7e5a75fb..92ac6a0c 100644
--- a/dev/tui/tui.zig
+++ b/dev/tui/tui.zig
@@ -738,14 +738,23 @@ pub fn runClient(init: std.process.Init, opts: pardes.Options, path: []const u8,
if (comptime builtin.os.tag == .freebsd)
posix.sigaction(.WINCH, &.{ .handler = .{ .handler = keepSignal }, .mask = posix.sigemptyset(), .flags = 0 }, null);
posix.sigprocmask(posix.SIG.BLOCK, &winch_set, null);
- var start: client_loop.Start = undefined;
- if (!start.open(init, opts, .{ .path = path, .session = session, .far = far_link })) Said.no(io, "{s}", .{start.said()});
- defer start.close();
var tty_buf: [0x10000]u8 = undefined;
var screen: Screen = .{ .io = io, .gpa = gpa, .env = init.environ_map, .buf = &tty_buf, .kitty = .init(gpa) };
defer screen.kitty.deinit();
- try screen.enter(try vaxis.Tty.init(io, &tty_buf));
+ // A pair's terminal is its own before its join, as the own frontend's
+ // is before its core: that join is the pair's whole start (its own
+ // boot, replica.ownBoot), and keys typed meanwhile are its input, not
+ // echoed by the line discipline and lost as it enters. An attach enters
+ // once joined, a refusal said on the terminal as it was.
+ if (opts.pair != null) try screen.enter(try vaxis.Tty.init(io, &tty_buf));
defer screen.leave();
+ var start: client_loop.Start = undefined;
+ if (!start.open(init, opts, .{ .path = path, .session = session, .far = far_link })) {
+ screen.leave();
+ Said.no(io, "{s}", .{start.said()});
+ }
+ defer start.close();
+ if (opts.pair == null) try screen.enter(try vaxis.Tty.init(io, &tty_buf));
defer screen.glide.deinit(gpa);
defer screen.art.deinit(gpa);
var paste_buf: std.Io.Writer.Allocating = .init(gpa);
@@ -1631,9 +1640,12 @@ const Shell = struct {
return false;
}
- /// Terminal `screen` (its view live) is `ws` big.
+ /// Terminal `screen` (its view live) is `ws` big; the size it has is no
+ /// resize (a client's start takes its size before its input thread's
+ /// first one comes: Tty.start).
fn resized(s: *Shell, screen: ?*Screen, ws: vaxis.Winsize) void {
if (screen) |sc| {
+ if (sc.size) |was| if (std.meta.eql(was, ws)) return;
sc.size = ws;
sc.vx.resize(s.gpa, sc.tty.writer(), ws) catch {};
}