diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-17 22:24:45 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-17 22:47:38 -0300 |
| commit | b1b69886cce63c53f8407d2a37e29fd8876b5fe8 (patch) | |
| tree | b3eda0a305f99fc6309dc4240895e4331c48c71a | |
| parent | 920110be4c597b4b93fc2d38179c09b335186253 (diff) | |
| download | pardes-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
| -rw-r--r-- | docs/typ/command-line.txt | 17 | ||||
| -rw-r--r-- | docs/typ/guide.typ | 2 | ||||
| -rw-r--r-- | docs/typ/reference.typ | 13 | ||||
| -rw-r--r-- | docs/typ/running.typ | 21 | ||||
| -rw-r--r-- | src/fs-help.txt | 2 | ||||
| -rw-r--r-- | src/gui/gui.zig | 2 | ||||
| -rw-r--r-- | src/main.zig | 17 | ||||
| -rw-r--r-- | src/tui/tui.zig | 4 | ||||
| -rw-r--r-- | test/daemon.py | 4 |
9 files changed, 42 insertions, 40 deletions
diff --git a/docs/typ/command-line.txt b/docs/typ/command-line.txt index 5045a983..0b06275e 100644 --- a/docs/typ/command-line.txt +++ b/docs/typ/command-line.txt @@ -38,10 +38,11 @@ The old spellings --ps, --attach[=NAME], --kill=NAME, --kill-all, -h and == pardes help ps -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). Usage: pardes ps @@ -55,8 +56,8 @@ See also: attach, kill, /sessions 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 @@ -109,7 +110,7 @@ Flags: --9p-tcp=tcp!IP!PORT also serve 9P there, a numeric address --mount=NAME=DIAL a 9P session or Unix/TCP endpoint under /n/NAME; repeat for more; os and self are reserved --geometry=WxH[+X+Y] the window's size in points, and where it goes where the display lets a window say (X11) - --detach[=NAME] 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[=NAME] 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, --wait 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') -- the end of the flags: pardes -- -name opens -name @@ -264,7 +265,7 @@ pager write a directory: its one +Pager, made or emptied; read the same op log events: new del rename save newcol delcol run exit send ask answer changed dump restore restored restoredcol msg err screen the rendered screen as JSON, frozen from open to close listeners the session's dial addresses -sessions the pardes daemon's, as pardes --ps: daemon <pid>; session <pid> tty|gui attached|detached <name>; shell <pid>; orphan <pid> +sessions the pardes daemon's, as pardes ps lists them: daemon <pid>; session <pid> tty|gui attached|detached <name> (attached: it has a frontend of its own); client <pid> for each of its clients; shell <pid>; orphan <pid> focus the serial of the pane with the keyboard (empty on a column tag); write one to give it the keyboard kbdin write runes: keys typed at the pane with the keyboard, done before the write answers (\x1b Esc, \n Enter) mousein write `m col row buttons` (1 left, 2 middle, 4 right): the mouse as it now is; m 10 5 4, m 10 5 0 is a right click diff --git a/docs/typ/guide.typ b/docs/typ/guide.typ index c78b8149..9bbdba65 100644 --- a/docs/typ/guide.typ +++ b/docs/typ/guide.typ @@ -354,7 +354,7 @@ cheatsheet (#doc("cheatsheet")) say so. pardes --detach=work & a session with no screen of its own pardes --attach=work show it here pardes-gui --attach=work a window session's window again -pardes --ps every session the daemon keeps, and its shells +pardes --ps every session the daemon lists, and its shells pardes --kill=work end it and its shells (--kill-all: every one) ``` diff --git a/docs/typ/reference.typ b/docs/typ/reference.typ index dff79859..7a01243c 100644 --- a/docs/typ/reference.typ +++ b/docs/typ/reference.typ @@ -1008,10 +1008,10 @@ at 200, ending in `…`. Control characters become spaces. `+Pager` of the session's. - #file("/listeners"): the session's dial addresses, a line each (#doc("building", section: "listeners")). -- #file("/sessions"): what the pardes daemon keeps, as `pardes --ps` +- #file("/sessions"): what the pardes daemon lists, as `pardes ps` shows it, a record a line: `daemon <pid>`, then `session <pid> tty|gui - attached|detached <name>` (attached: it has a terminal or window of its - own) with a `client <pid>` line for each of its clients and a + attached|detached <name>` (attached, the daemon's word: it has a frontend + of its own, a terminal or window; `pardes ps` says "has a frontend") with a `client <pid>` line for each of its clients and a `shell <pid>` line for each shell it holds, then `orphan <pid>` for each shell no session holds. Any of the names attaches (`pardes --attach=<name>`, either kind). Read fails `no @@ -1332,8 +1332,9 @@ to its end before the write is answered, and one that finds nothing fails, another; a removed line's `-` goes to the line now standing where it was. git's `a/` `b/` (and `c/ i/ w/ o/`) prefixes are dropped; a `--no-prefix` diff's paths are kept. -- *Sessions.* `pardes --ps` prints what the daemon keeps: each session - (its pid, terminal or window, attached or detached, name) with the pids +- *Sessions.* `pardes --ps` prints what the daemon lists: each session + (its pid, terminal or window, whether it has a frontend or is detached, + name) with the pids and commands of its clients and of the shells it holds, then the shells no session holds, which #word("Adopt") takes. `--kill=NAME` ends that session and its shells (a TERM, then a KILL 2 s later; unsaved changes are lost), @@ -1344,7 +1345,7 @@ to its end before the write is answered, and one that finds nothing fails, only session of that kind, joined as a client (with none of that kind, the only session there is); a second `--detach=NAME` while NAME runs (a plain session is named by its pid) says so in words - and exits 1. A session attached already is joined as a client, as one of + and exits 1. A session with a frontend already is joined as a client, as one of the other kind is, and one on another machine (`--attach=HOST:NAME`, over `ssh -L`; `--attach=SOCKET:NAME` through a socket forwarded already): its own process, listed under the session by `--ps`, up to three clients diff --git a/docs/typ/running.typ b/docs/typ/running.typ index 0686dce5..65498380 100644 --- a/docs/typ/running.typ +++ b/docs/typ/running.typ @@ -245,20 +245,19 @@ started it. After an #word("Upgrade"), a session's command line starts with [*stub*], [the process your shell waits on when the session is not it], ) -The code, its messages and the older notes still use other words for the -same things, until the code is renamed: +The code says these words too, each for one thing of its own (the older +notes, `docs/next-daemon.md` among them, still say `remote` for a client +and `headless` for detached): -// tui.zig:622-667, gui.zig:769-776, main.zig:1683-1687 (remote); -// main.zig:1523, gui.zig:765-829, :2381-2384 (headless, parked); -// replica.zig:1850-1852 (alone_unattended); replica.zig:1-19 (authority); -// tui.zig:1189, gui.zig:2379 (Shell); replica.zig:1832-1876, :2809-2812 -// (Peers, Link, Joining); daemon.zig:799 (ps's attached and detached). +// replica.zig:1-19 (authority); replica.zig:1832-1876, :2812 (Peers, Link, +// Joining); tui.zig:1189, gui.zig:2379 (Shell); Core.zig:269-271, +// replica.zig:1850-1852 (unattended against detached); daemon.zig:283, +// :363, :799 (the daemon's attached and detached), main.zig:1616 (`ps` +// says "has a frontend"). #pairs( - [`remote`, `Remote`], [a client, on this machine too; another machine's is *far*], - [`headless`, `parked`, `unattended`, `alone_unattended`], [detached, or nobody looking], [`authority`], [the session's core, inside the replica engine; `replica`, a client's core], [`Peers`, `Peer`; `Link`, `Joining`, `Joined`], [a session's clients, seen from the session; a client's connection, seen from the client], [`Shell`], [a frontend's host object (`tui.zig`, `gui.zig`); elsewhere the user's shell], - [`attached`, `detached` in `pardes ps` and #file("/sessions")], [whether the session has a frontend of its own], - [a daemon that "keeps" a session], [one it has on its list], + [`unattended`], [a detached session with no client either: nobody looks, so a message goes on the clock], + [`attached` in #file("/sessions")], [the daemon's word for a session with a frontend of its own; `pardes ps` says "has a frontend"], ) diff --git a/src/fs-help.txt b/src/fs-help.txt index 9a87843d..76ad7c5e 100644 --- a/src/fs-help.txt +++ b/src/fs-help.txt @@ -9,7 +9,7 @@ pager write a directory: its one +Pager, made or emptied; read the same op log events: new del rename save newcol delcol run exit send ask answer changed dump restore restored restoredcol msg err screen the rendered screen as JSON, frozen from open to close listeners the session's dial addresses -sessions the pardes daemon's, as pardes --ps: daemon <pid>; session <pid> tty|gui attached|detached <name>; shell <pid>; orphan <pid> +sessions the pardes daemon's, as pardes ps lists them: daemon <pid>; session <pid> tty|gui attached|detached <name> (attached: it has a frontend of its own); client <pid> for each of its clients; shell <pid>; orphan <pid> focus the serial of the pane with the keyboard (empty on a column tag); write one to give it the keyboard kbdin write runes: keys typed at the pane with the keyboard, done before the write answers (\x1b Esc, \n Enter) mousein write `m col row buttons` (1 left, 2 middle, 4 right): the mouse as it now is; m 10 5 4, m 10 5 0 is a right click diff --git a/src/gui/gui.zig b/src/gui/gui.zig index 2df408e8..9bd6f5b9 100644 --- a/src/gui/gui.zig +++ b/src/gui/gui.zig @@ -2480,7 +2480,7 @@ const Shell = struct { // A replica client's: its link ends. if (s.peers.detach(s.core.live)) return; if (s.gui == null) return s.core.reportFailure(s.core.view().active, "Detach: no window is open"); - if (!daemon.kept()) return s.core.reportFailure(s.core.view().active, "Detach: no pardes daemon keeps this session; closing its window ends it"); + if (!daemon.kept()) return s.core.reportFailure(s.core.view().active, "Detach: no pardes daemon lists this session; closing its window ends it"); s.closeTheWindow(); } 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, diff --git a/src/tui/tui.zig b/src/tui/tui.zig index 1c6a3b7f..349ced56 100644 --- a/src/tui/tui.zig +++ b/src/tui/tui.zig @@ -1350,8 +1350,8 @@ const Shell = struct { const s = of(ctx); // A replica client's: its link ends. if (s.peers.detach(s.core.live)) return; - if (s.detached()) return s.core.reportFailure(s.core.view().active, "Detach: no terminal is attached"); - if (!daemon.kept()) return s.core.reportFailure(s.core.view().active, "Detach: no pardes daemon keeps this session (it is its terminal's job)"); + if (s.detached()) return s.core.reportFailure(s.core.view().active, "Detach: detached already (no terminal of its own)"); + if (!daemon.kept()) return s.core.reportFailure(s.core.view().active, "Detach: no pardes daemon lists this session (it is its terminal's job)"); s.leaveTerminal(); } diff --git a/test/daemon.py b/test/daemon.py index 622684f6..5c620ba4 100644 --- a/test/daemon.py +++ b/test/daemon.py @@ -879,13 +879,13 @@ def window_clients(binary, gui_binary): wait_for('the terminal client agrees with the window', lambda: agreed(root / 'b.check', nb), timeout=30) wait_for('the window client agrees with the window', lambda: agreed(root / 'g.check', ng), timeout=30) listed = sessions_listed(binary, env, root) - assert [(n, k) for n, _, k in listed] == [('win', '(gui, attached)')], listed + assert [(n, k) for n, _, k in listed] == [('win', '(gui, has a frontend)')], listed assert wg.close() == 0, wg.said()[-800:] os.write(tb.master, b' sD') wait_for('the terminal client let go', lambda: b.poll() is not None, timeout=10) assert win.p.poll() is None print(f'daemon: a window\'s session served a terminal\'s client and a window\'s, digests agreed ' - f'{len(checks(root / "b.check"))} and {len(checks(root / "g.check"))} times; --ps listed it alone, (gui, attached)') + f'{len(checks(root / "b.check"))} and {len(checks(root / "g.check"))} times; --ps listed it alone, (gui, has a frontend)') win.close() nine.socket.close() wait_for('nothing left', lambda: not [p for p in processes(root) if alive(p)], timeout=15) |
