From fe0aa07c18a9fd5ca6bdcb78e9354a2745e32298 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sat, 21 Nov 2026 03:29:45 -0300 Subject: client: what the pair's last rounds left, each a test first: a window client exec'd at its session's Upgrade comes back the size it was, not the default (runtime/client.zig `execAgain` passed `--attach=` alone, so the new process made a 1120x720 window: a `--geometry=900x560` pair's session went from 56x16 to 70x20 after an Upgrade to another build, with the variable or without (any `pardes-gui attach`); now the window's size at the exec, SDL_GetWindowSize, as `--geometry=WxH`); a pair's client exec'd at an Upgrade waits for its session at `ended` as before the exec (tui.zig and gui.zig `runClient` asked `opts.pair`, which the exec'd `--attach=` client has not: now every near client waits, a non-child answers ECHILD at once; not seen to fail here: the subreaper took the session first); tests in test/daemon.py: `pair_upgrade_views` (plain, --pair: two clients' own views, the pair's scroll and the attach's focus, the same after a same-build Upgrade: the screens by pyte, the focus by where typing lands: passed before this change too), `pair_exec_reaps`, `far_exec` (a far client, PARDES_REPLICA_FAR by the socket's path, execs the build at its start path and agrees after: passed before too), `pair_window_geometry` (offscreen, not test mode: failed before), the last three in --upgrade OLD NEW Co-Authored-By: Claude Opus Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- runtime/client.zig | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'runtime') diff --git a/runtime/client.zig b/runtime/client.zig index c550b0fa..22e60fc1 100644 --- a/runtime/client.zig +++ b/runtime/client.zig @@ -125,11 +125,14 @@ pub const Ended = union(enum) { done, gone, failed, left, ended: u8, upgrade: u8 /// process's child still), joining for `view` (PARDES_JOIN_VIEW; far, /// PARDES_REPLICA_FAR). The terminal's blink: no record crosses the exec. /// Returns only when the exec failed: why. -pub fn execAgain(s: *Start, view: u8) []const u8 { +pub fn execAgain(s: *Start, view: u8, size: ?[2]c_int) []const u8 { const path = upgrade.exe() orelse return "Upgrade: this client does not know the path it was started from"; var at_buf: [4200]u8 = undefined; const at = std.fmt.bufPrintSentinel(&at_buf, "--attach={s}:{s}", .{ s.dial.path, s.dial.session }, 0) catch return "Upgrade: the session's socket's path is too long to attach again by"; - const argv = [_:null]?[*:0]const u8{ path, at }; + // A window's new window the size it had (`--geometry`), not the default. + var size_buf: [48]u8 = undefined; + const geometry: ?[*:0]const u8 = if (size) |wh| (std.fmt.bufPrintSentinel(&size_buf, "--geometry={d}x{d}", .{ wh[0], wh[1] }, 0) catch unreachable).ptr else null; // two c_ints fit 48 + const argv = [_:null]?[*:0]const u8{ path, at, geometry }; var view_buf: [32]u8 = undefined; const joining = std.fmt.bufPrintSentinel(&view_buf, "PARDES_JOIN_VIEW={d}", .{view}, 0) catch unreachable; // a u8 fits 32 var n: usize = 0; -- cgit v1.3