summaryrefslogtreecommitdiff
path: root/docs/next-run.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/next-run.md')
-rw-r--r--docs/next-run.md62
1 files changed, 33 insertions, 29 deletions
diff --git a/docs/next-run.md b/docs/next-run.md
index dc189bc6..06941026 100644
--- a/docs/next-run.md
+++ b/docs/next-run.md
@@ -11,7 +11,7 @@ stays as built; the vocabulary and the manual's page first, no code moved
yet. Nothing in this note is built. What runs today, with a figure for each
way of starting pardes, is the manual's "How pardes runs"
(`docs/typ/running.typ`); the daemon's history is `docs/next-daemon.md`.
-Line numbers are this tree's, 2026-11-17.
+Line numbers are this tree's, 2026-11-19.
## The ruling
@@ -38,7 +38,7 @@ docs/next-run.svg`).
Today `pardes attach` is four mechanisms, picked by the daemon's `find`
(`runtime/daemon.zig:901-972`) and by `main.zig`'s `attachTo`
-(`runtime/main.zig:1774-1810`): a terminal handed to a detached terminal's
+(`runtime/main.zig:1806-1842`): a terminal handed to a detached terminal's
session, which draws on it in its own process while the attach process
waits as its stub; a window's detached session asked to open its own
window again, while the attach process exits; a client here, when the
@@ -51,19 +51,19 @@ The reorganisation plan's option b, checked against this tree:
| What goes | Where today | Lines, about |
|---|---|---|
-| A terminal handed to a session: the daemon's `attach` request and answer, the session's `attachTerminal`, the `attach` note and message | `daemon.zig:400-403`, `:431-437`, `:504-533`, `:883-897`; `tui.zig:105-107`, `:1065-1068`, `:1162-1167`, `:1373-1406`, `:1723`; `main.zig:1789-1810` | 110 |
-| A window opened again in place | `gui.zig:540-544` (what it reopens with), `:982-1000` (`reopenWindow`), `:2534-2547` (`openTheWindow`), `:2753`, `:3275-3281` | 50 |
-| The daemon choosing which session takes a frontend: `find`, its `other` answer, the use of `daemon.Kind` to match | `daemon.zig:901-972`, `:506-509` | 75 |
-| The stub's second use: an attach process waiting on a session that is not its child (`stubWait`'s `child = false`, its `r` refusals) | `daemon.zig:561-616` in part (`:593-597`, `:613-615`) | 10 |
+| A terminal handed to a session: the daemon's `attach` request and answer, the session's `attachTerminal`, the `attach` note and message | `runtime/daemon.zig:400-403`, `:431-437`, `:504-533`, `:883-897`; `dev/tui/tui.zig:107-109`, `:1037-1040`, `:1135-1140`, `:1354-1387`, `:1711`; `runtime/main.zig:1821-1842` | 110 |
+| A window opened again in place | `dev/gui/gui.zig:550-557` (what it reopens with), `:1004-1022` (`reopenWindow`), `:2588-2601` (`openTheWindow`), `:2823`, `:3388-3394` | 50 |
+| The daemon choosing which session takes a frontend: `find`, its `other` answer, the use of `daemon.Kind` to match | `runtime/daemon.zig:901-972`, `:506-509` | 75 |
+| The stub's second use: an attach process waiting on a session that is not its child (`stubWait`'s `child = false`, its `r` refusals) | `runtime/daemon.zig:561-616` in part (`:593-597`, `:613-615`) | 10 |
What does not go, against the plan's list: the upgrade record's terminal
and window fields. A session born with a terminal still takes it across an
-Upgrade (`tui.zig:1455-1463`, `upgrade.zig:101-117`), and a window's still
-says whether it had its window (`gui.zig:2600`). Only the record's other
-terminals (`tui.zig:1504-1523`, a build's from before 2026-11-06, when a
+Upgrade (`dev/tui/tui.zig:1438-1446`, `runtime/upgrade.zig:101-117`), and a window's still
+says whether it had its window (`dev/gui/gui.zig:2656`). Only the record's other
+terminals (`dev/tui/tui.zig:1487-1506`, a build's from before 2026-11-06, when a
second local terminal stopped being the session's) are already dead weight.
-Detach of the session's own frontend stays too (`tui.zig:1346-1371`,
-`gui.zig:2476-2485`, `:2521-2532`): it is how a session becomes detached.
+Detach of the session's own frontend stays too (`dev/tui/tui.zig:1327-1352`,
+`dev/gui/gui.zig:2530-2539`, `:2575-2586`): it is how a session becomes detached.
`daemon.Kind` stays in the hello and in `pardes ps` (`tty` or `gui`).
The plan counted 87 + about 60 + 67 lines for the first three rows; the
@@ -102,15 +102,16 @@ what is true, and whether it was measured.
for the wheel, measured (`.scratch/sketch/reports/pardes-measure.md`
sections C and E): a notch in a client glides as it does in the
session's own window (5 frames, 0 to -22 px, in both). Only whole rows
- go to the session (`gui.zig:2147-2161`; its comment and
- `docs/next-daemon.md`'s GUI replica notes still say "no glide"); the
+ go to the session (`dev/gui/gui.zig:2200-2214`; its comment still says
+ "no glide", which `docs/next-daemon.md`'s GUI replica notes said too
+ until 2026-11-19); the
picture moves between them on the client's own clock (`glideFrame`,
- `gui.zig:3544`). A touchpad's fractions are the client window's own
+ `dev/gui/gui.zig:3673`). A touchpad's fractions are the client window's own
picture too (the test "detached trackpad scrolling keeps fractions local
- and queues whole rows for replication", `gui.zig:8042`). Fonts: a client follows the session's font request by
+ and queues whole rows for replication", `dev/gui/gui.zig:8190`). Fonts: a client follows the session's font request by
the face's name when that face is installed on its machine
- (`gui.zig:580-608`, `syncReplicaFont`); its opacity is its own (not in
- the client's per-frame chores, `gui.zig:1311-1323`). The note said "keeps
+ (`dev/gui/gui.zig:595-623`, `syncReplicaFont`); its opacity is its own (not in
+ the client's per-frame chores, `dev/gui/gui.zig:1296-1322`). The note said "keeps
its own font"; it is corrected there. Measured: a face the client lacks
leaves it at its old face and its old size, and it diverged and joined
again (2 runs of 2, cause not found).
@@ -122,29 +123,32 @@ what is true, and whether it was measured.
## A session registering again
-Today a session says hello once, at its start (`main.zig:1535-1563`), or
-on its link after an Upgrade (`daemon.zig:392-398`). When the daemon dies
-the session's reader sees the link end (`daemon.zig:419-425`) and nothing
+Today a session says hello once, at its start (`runtime/main.zig:1567-1595`), or
+on its link after an Upgrade (`runtime/daemon.zig:392-398`). When the daemon dies
+the session's reader sees the link end (`runtime/daemon.zig:419-425`) and nothing
dials again, so the session runs on unlisted: `pardes ps` and attach do not
find it, Detach and Adopt refuse, and its frontend closing ends it
-(`tui.zig:1711-1721`, `gui.zig:1784`). The next daemon knows only the
+(`dev/tui/tui.zig:1699-1709`, `dev/gui/gui.zig:1839`). The next daemon knows only the
sessions that start after it.
The work: when `gone` is set, the session's loop (which calls
-`daemon.watch` each iteration already, `tui.zig:1115`, `gui.zig:1154`)
+`daemon.watch` each iteration already, `runtime/session.zig:115`, `:133-135`)
dials again, starting a daemon if none answers (`daemon.connect(true)`),
says its hello with its state, sends a dup of every pty master it holds
-(at most 64 fds a message, `daemon.zig:37`), and its clients' pids. What
+(at most 64 fds a message, `runtime/daemon.zig:37`), and its clients' pids. What
cannot come back: the shells of sessions killed earlier, which only the
dead daemon held.
## `--detach` forking
-Today `--detach` is the launch process itself (`main.zig:1502-1537`): it
-blocks the shell unless backgrounded by hand, it stays the job of the
-terminal it was typed in, and a window's detached session ends on that
-terminal's hangup (no handler of its own: `9p_io.zig:704-729`). The work:
-fork as `daemon.forkSession` does (`daemon.zig:663-698`), `setsid` in the
+Today `--detach` is the launch process itself (`runtime/main.zig:1517-1569`): it
+blocks the shell unless backgrounded by hand, and it stays the job of the
+terminal it was typed in. `pardes-gui --detach` runs the `pardes` beside
+it in its place (`runtime/main.zig:1518-1534`), so a window's binary is a
+detached session only where no `pardes` is beside it, and that one ends
+on its terminal's hangup (no handler of its own:
+`runtime/9p_io.zig:704-729`). The work:
+fork as `daemon.forkSession` does (`runtime/daemon.zig:663-698`), `setsid` in the
child, its stdin, stdout and stderr on `/dev/null`, and the parent
printing the session's name and exiting 0, with no stub (nothing waits on
it). For the window's build the fork comes before SDL starts. Then
@@ -181,7 +185,7 @@ session takes back.
- Re-registration: dial again at once and back off, or only when
something needs the daemon (a Detach, an Adopt, the frontend closing)?
- `--detach` with no daemon starts a session nothing can attach to
- (`main.zig:1535-1537` ignores the failed registration). Refuse, or keep
+ (`runtime/main.zig:1567-1569` ignores the failed registration). Refuse, or keep
it as a 9P-only session?
- `pardes ps` says "has a frontend" for a session with a frontend of its
own (the daemon's list, and so /sessions, still says `attached`, a wire