diff options
Diffstat (limited to 'dev')
| -rw-r--r-- | dev/gui/gui.zig | 2 | ||||
| -rw-r--r-- | dev/tui/tui.zig | 10 |
2 files changed, 12 insertions, 0 deletions
diff --git a/dev/gui/gui.zig b/dev/gui/gui.zig index 36243c71..60176642 100644 --- a/dev/gui/gui.zig +++ b/dev/gui/gui.zig @@ -1444,6 +1444,8 @@ fn clientSession(init: std.process.Init, g: *Gui, opts_in: pardes.Options, test_ .done => {}, .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)}), .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 {}; diff --git a/dev/tui/tui.zig b/dev/tui/tui.zig index bf051e9a..a3889d28 100644 --- a/dev/tui/tui.zig +++ b/dev/tui/tui.zig @@ -817,6 +817,12 @@ pub fn runClient(init: std.process.Init, opts: pardes.Options, path: []const u8, screen.leave(); Said.no(io, "{s}", .{start.said()}); }, + .upgrade => |view| { + // 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)}); + }, } } @@ -1315,6 +1321,10 @@ const Shell = struct { const core = s.core; var why: [800]u8 = undefined; const path = upgrade.exe() orelse return core.reportFailure(pane, "Upgrade: this process does not know the path it was started from"); + // A client of a session no daemon keeps is a pair's first (no other + // can attach): let go, it has no socket to find the session again + // by, and the session would end with its last link. + if (s.peers.count() > 0 and daemon.link < 0) return core.reportFailure(pane, "Upgrade: no daemon keeps this session, so its client could not join it again; this session stays as it is"); // 9P is served while the new binary is asked (its clients' clunks // and reads after the word are answered), and not after. pardes.turn.rest(); |
