summaryrefslogtreecommitdiff
path: root/runtime/session.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-20 08:36:06 -0300
committerGabriel Schneider <[email protected]>2026-11-20 08:36:06 -0300
commit446cde19a6b6fb7125fc749608cc12b7452dad6e (patch)
treea7c2792ecdb1833a2e5a3ef99b9fb6ce96c01a00 /runtime/session.zig
parent2c2800c93e5417297dd06d3e52d5d336d975560c (diff)
parentae3b9e9d19492c827f257da8a224a19d77de51c1 (diff)
downloadpardes-446cde19a6b6fb7125fc749608cc12b7452dad6e.tar.gz
pardes-446cde19a6b6fb7125fc749608cc12b7452dad6e.zip
integration: a session's first client over an inherited socket before its first effects, the pair under PARDES_PAIR, and a session's last word, on the 9P run's fixes and the build's second pass: pardes-first-client (new --detach forks and returns; Options.pair and the join by fd; pardes FILE as a client and a session under the variable; ended CODE and left NAME: a client's own Detach exits 0 with its line again) and pardes-merge33, merged without a textual conflict; tui core-test 858/1013 (155 skipped), shell-test 1053/1056, the window builds; the coordinator's gate in the ledger (reorg/merge34)
Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'runtime/session.zig')
-rw-r--r--runtime/session.zig11
1 files changed, 11 insertions, 0 deletions
diff --git a/runtime/session.zig b/runtime/session.zig
index fdd72c2b..5d7eff78 100644
--- a/runtime/session.zig
+++ b/runtime/session.zig
@@ -103,6 +103,10 @@ pub fn Loop(comptime Frontend: type) type {
defer l.peers.deinit();
// Before the core goes: each client sees its link end.
defer l.peers.dropAll(l.core);
+ // A first client on the socket it was started with, before its
+ // first effects: it has every terminal from its first byte, and
+ // no reload (Core.openView).
+ if (o.pair) |fd| l.peers.join(l.core, .{ .fd = fd });
l.effects();
// ...and its shells, once a fresh session's own has a directory
// to adopt them in.
@@ -113,12 +117,17 @@ pub fn Loop(comptime Frontend: type) type {
l.ptys.start(l.core);
l.watches.start();
try fe.start(&l);
+ // A `new --detach`'s launch returns now.
+ daemon.launched();
while (!l.core.quit) {
pardes.turn.bump(&pardes.turn.restores);
try l.core.pump(l.host);
// Its unit to each replica client, and theirs taken in.
l.peers.boundary(l.core);
+ // A pair's session with no daemon ends with its last link:
+ // nothing could attach to it again.
+ if (o.pair != null and daemon.link < 0 and l.peers.count() == 0) break;
fe.sent();
upgrade.locate();
// Asked in the step (the word), done between steps: the
@@ -132,6 +141,8 @@ pub fn Loop(comptime Frontend: type) type {
if (l.core.quit) break;
if (l.core.takeRestore()) |rp| l.restore(rp);
}
+ // The clients' last word: the session ended (Exit).
+ l.peers.ended(0);
// Its serve threads read the core: they end first.
if (l.fs) |f| {
f.deinit(l.gpa);