summaryrefslogtreecommitdiff
path: root/src/main.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-17 22:24:45 -0300
committerGabriel Schneider <[email protected]>2026-11-17 22:47:38 -0300
commitb1b69886cce63c53f8407d2a37e29fd8876b5fe8 (patch)
treeb3eda0a305f99fc6309dc4240895e4331c48c71a /src/main.zig
parent920110be4c597b4b93fc2d38179c09b335186253 (diff)
downloadpardes-b1b69886cce63c53f8407d2a37e29fd8876b5fe8.tar.gz
pardes-b1b69886cce63c53f8407d2a37e29fd8876b5fe8.zip
words: what a person reads says the ruled words (PARDES.md ruling 1): `pardes ps` prints a session with a frontend of its own as "(tty, has a frontend)" where it said "(tty, attached)" ("detached" stays, its clients listed under it as before; the daemon's list keeps its wire word `attached`, so /sessions and an older daemon read the same); `pardes help ps` "What the per-user daemon lists: ... whether it has a frontend of its own or is detached" (it said "keeps" and "whether one is attached"), `pardes help attach` "One with a frontend already" ("One attached already"), `--detach`'s help "One pardes --daemon per user lists them, for attach" ("keeps sessions"); Detach's refusals "no pardes daemon lists this session" ("keeps") in the terminal and the window, and "Detach: detached already (no terminal of its own)" ("no terminal is attached"); the README's /sessions line names `attached` (a frontend of its own) and the `client <pid>` lines the daemon sends; docs/typ/command-line.txt written again from `pardes help --all` (the golden that moved: its ps, attach, --detach and sessions lines); test/daemon.py's window case reads "(gui, has a frontend)"; the manual follows: running.typ's list of older words keeps only the code's own (authority, Peers/Link, Shell, unattended, /sessions's attached), reference.typ's /sessions and Sessions, guide.typ's ps line ("lists"); NOT renamed: the daemon's hello and state words (wire), the 9P file /sessions's content, the builtins Detach, Adopt and Unattach; tui core-test 811/950 (139 skipped), shell-test 993/996 (the command-line.txt test with it), behaviour-test 269/273 (the four addon ABI tests the base fails), process-test 2 of 144 failed (lspcomplete and lspcompletemoved, the base's), daemon.py main passes; gui frame corpus 77/77 byte-identical against mbase, unit-test 1582/1590 (the base's 8 failures); the book and the site compile
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/main.zig b/src/main.zig
index 36d2da75..864e2485 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -268,10 +268,11 @@ const cmds = std.EnumArray(Cmd, Doc).init(.{
.group = .Sessions,
.line = "the daemon's sessions, their clients and shells",
.doc =
- \\What the per-user daemon keeps: each session with its name, pid, kind
- \\(tty or gui) and whether one is attached; under it its clients and its
- \\shells; then the shells no session holds, which Adopt takes. /sessions
- \\is the same list, read from inside a session.
+ \\What the per-user daemon lists: each session with its name, pid, kind
+ \\(tty or gui) and whether it has a frontend of its own or is detached;
+ \\under it its clients and its shells; then the shells no session holds,
+ \\which Adopt takes. /sessions is the same list, read from inside a
+ \\session (where a session with a frontend says attached).
,
.examples = &.{.{ "pardes ps", "every session, client and shell" }},
.see = "attach, kill, /sessions",
@@ -283,8 +284,8 @@ const cmds = std.EnumArray(Cmd, Doc).init(.{
.doc =
\\Show a detached session here: in this terminal for pardes, a window
\\for pardes-gui. Bare, the one detached session (with none, the one
- \\session). One attached already, or of the other kind, is joined as a
- \\client. HOST:NAME is a client of session NAME on another machine,
+ \\session). One with a frontend already, or of the other kind, is joined
+ \\as a client. HOST:NAME is a client of session NAME on another machine,
\\over `ssh -L` to its pardes-replica.sock ($PARDES_SSH: the ssh
\\command, default ssh; $PARDES_REMOTE_RUNTIME: its runtime directory,
\\if not this one's path); SOCK:NAME goes through a socket forwarded
@@ -467,7 +468,7 @@ const flags = std.EnumArray(Flag, FlagDoc).init(.{
.@"--9p-tcp" = .{ .arg = "=tcp!IP!PORT", .takes = .eq, .doc = "also serve 9P there, a numeric address" },
.@"--mount" = .{ .arg = "=NAME=DIAL", .takes = .eq, .doc = "a 9P session or Unix/TCP endpoint under /n/NAME; repeat for more; os and self are reserved" },
.@"--geometry" = .{ .arg = "=WxH[+X+Y]", .takes = .eq, .doc = "the window's size in points, and where it goes where the display lets a window say (X11)" },
- .@"--detach" = .{ .arg = "[=NAME]", .takes = .maybe, .doc = "no terminal (no window) until one attaches; panes, shells and files stay; NAME (one path component) rather than the pid. One pardes --daemon per user keeps sessions (PARDES_DAEMON=off: none)" },
+ .@"--detach" = .{ .arg = "[=NAME]", .takes = .maybe, .doc = "no terminal (no window) until one attaches; panes, shells and files stay; NAME (one path component) rather than the pid. One pardes --daemon per user lists them, for attach (PARDES_DAEMON=off: none)" },
.@"-w" = .{ .group = .open },
.@"--wait" = .{ .group = .open, .doc = "in a pane, hand FILE to its session and return once its pane is deleted: 0, or 1 if the session goes (EDITOR='pardes --wait')" },
.@"--" = .{ .group = .open, .doc = "the end of the flags: pardes -- -name opens -name" },
@@ -1612,7 +1613,7 @@ fn manage(io: std.Io, verb: enum { list, kill, killall }, name: []const u8) nore
.session => {
const kind = it.next() orelse "";
const state = it.next() orelse "";
- w.print(" session {s} {s} ({s}, {s})\n", .{ std.mem.trim(u8, it.rest(), " "), pid, kind, state }) catch break;
+ w.print(" session {s} {s} ({s}, {s})\n", .{ std.mem.trim(u8, it.rest(), " "), pid, kind, if (std.mem.eql(u8, state, "attached")) "has a frontend" else state }) catch break;
},
.client => w.print(" client {s} {s}\n", .{ pid, comm }) catch break,
.shell => w.print(" shell {s} {s}\n", .{ pid, comm }) catch break,