summaryrefslogtreecommitdiff
path: root/src
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
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')
-rw-r--r--src/fs-help.txt2
-rw-r--r--src/gui/gui.zig2
-rw-r--r--src/main.zig17
-rw-r--r--src/tui/tui.zig4
4 files changed, 13 insertions, 12 deletions
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();
}