summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-20 23:32:01 -0300
committerGabriel Schneider <[email protected]>2026-11-20 23:33:07 -0300
commit6d937cd125ca04a2edb92b2d014014ee6c2eb45d (patch)
treefe223643fdf8680430e735d2ae459a33efcd5514 /runtime
parent2a37bf10a19048576060b536d219f1f134a9baa0 (diff)
downloadpardes-6d937cd125ca04a2edb92b2d014014ee6c2eb45d.tar.gz
pardes-6d937cd125ca04a2edb92b2d014014ee6c2eb45d.zip
main: an upgraded session's `new` is the verb still, not a file's name: a session started as `pardes new [--detach=NAME] FILE` ENDED at its Upgrade: its new process is given the arguments it was started with after its record, the verbs were read only when not resuming, so `new` was taken for the file and FILE was 'the second' (badArgs: the process exits; its dump stays in the state file); with no file the session lived on by luck (`new` the ignored positional); found by the coordinator's check of the release build before the install (reorg/landing: eight variants: with a file dead in all four, without alive in all four, same build or another, on Debug and ReleaseSafe); test/daemon.py's pair rows: `new --detach=kd FILE` is upgraded, lives, and is attached to after
Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'runtime')
-rw-r--r--runtime/main.zig8
1 files changed, 8 insertions, 0 deletions
diff --git a/runtime/main.zig b/runtime/main.zig
index dc351c30..0751f6b0 100644
--- a/runtime/main.zig
+++ b/runtime/main.zig
@@ -1176,6 +1176,14 @@ fn nativeMain(std_init: std.process.Init) !void {
var positional: ?[:0]const u8 = null;
var wait = false;
var i: usize = if (resuming or paired != null) 2 else 1;
+ // An upgraded session's arguments are the ones it was started with: its
+ // `new` is the verb still, not a file's name (taken for one, the file
+ // after it was "the second" and the session ended at its Upgrade).
+ if (resuming and args.len > i and std.meta.stringToEnum(Cmd, args[i]) == .new) {
+ new_session = true;
+ new_verb = true;
+ i += 1;
+ }
// A command's name first: new and attach go on to start or join a
// session, with the flags after them; the rest are done in `command`.
if (!resuming and args.len > i) if (std.meta.stringToEnum(Cmd, args[i])) |cmd| switch (cmd) {