diff options
Diffstat (limited to 'dev')
| -rw-r--r-- | dev/gui/gui.zig | 16 | ||||
| -rw-r--r-- | dev/tui/tui.zig | 12 |
2 files changed, 18 insertions, 10 deletions
diff --git a/dev/gui/gui.zig b/dev/gui/gui.zig index 521f685f..d779cf47 100644 --- a/dev/gui/gui.zig +++ b/dev/gui/gui.zig @@ -1429,16 +1429,22 @@ fn clientSession(init: std.process.Init, g: *Gui, opts_in: pardes.Options, test_ .gone => Said.no(io, "'{s}' let this client go (a Detach in it, or the session's end)", .{to.session}), .failed => Said.no(io, "{s}", .{start.said()}), // A new process's window: the build at its start path, exec'd. - .upgrade => |view| Said.no(io, "{s}", .{client_loop.execAgain(&start, view)}), + .upgrade => |view| { + // Its new window the size this one has now. + var size: [2]c_int = .{ 0, 0 }; + _ = c.SDL_GetWindowSize(g.window, &size[0], &size[1]); + Said.no(io, "{s}", .{client_loop.execAgain(&start, view, size)}); + }, .left => { var said: [600]u8 = undefined; std.Io.File.stderr().writeStreamingAll(io, std.fmt.bufPrint(&said, "pardes-gui: detached from '{s}', which is still running; come back with `pardes-gui attach {s}`\n", .{ to.session, to.session }) catch "pardes-gui: detached\n") catch {}; std.process.exit(0); }, .ended => |code| { - // A pair's window is its session's parent: its status once it - // is gone, as the terminal's (tui.zig `runClient`). - if (opts_in.pair != null) { + // A pair's window is its session's parent, an exec'd one too: + // its status once it is gone, as the terminal's (tui.zig + // `runClient`). + if (!to.far) { var status: c_int = 0; while (libc.waitpid(@intCast(start.joined.pid), &status, 0) < 0 and libc.errno(-1) == .INTR) {} } @@ -2501,7 +2507,7 @@ const Shell = struct { core.settle(); // Its replica clients told, their views gone before the dump: each // dials the session again once it is back. - s.peers.refuseAll(core, "the session is upgrading to another build of pardes"); + s.peers.refuseAll(core); var rec: upgrade.Record = .{ .link = daemon.link, .window = s.gui != null, .exe = path }; s.ptys.record(&rec); var at_buf: [1024:0]u8 = undefined; diff --git a/dev/tui/tui.zig b/dev/tui/tui.zig index e441df92..09704424 100644 --- a/dev/tui/tui.zig +++ b/dev/tui/tui.zig @@ -800,9 +800,11 @@ pub fn runClient(init: std.process.Init, opts: pardes.Options, path: []const u8, }, .ended => |code| { screen.leave(); - // A pair's client is its session's parent: its status once it - // is gone, as a terminal's job ends with its program. - if (opts.pair != null) { + // A pair's client is its session's parent, an exec'd one too + // (an Upgrade's, which `opts.pair` no longer says): its status + // once it is gone, as a terminal's job ends with its program. + // Not its child: no wait (ECHILD at once). + if (!far_link) { var status: c_int = 0; while (libc.waitpid(@intCast(start.joined.pid), &status, 0) < 0 and libc.errno(-1) == .INTR) {} } @@ -816,7 +818,7 @@ pub fn runClient(init: std.process.Init, opts: pardes.Options, path: []const u8, // The blink: its screen left, the build at its start path // exec'd, which enters it again. screen.leave(); - Said.no(io, "{s}", .{client_loop.execAgain(&start, view)}); + Said.no(io, "{s}", .{client_loop.execAgain(&start, view, null)}); }, } } @@ -1306,7 +1308,7 @@ const Shell = struct { core.settle(); // Its replica clients told, their views gone before the dump: each // dials the session again once it is back. - s.peers.refuseAll(core, "the session is upgrading to another build of pardes"); + s.peers.refuseAll(core); var rec: upgrade.Record = .{ .link = daemon.link, .stub = daemon.stub, .exe = path }; s.ptys.record(&rec); if (s.screen) |sc| if (sc.on) rec.addTty(.{ |
