From 6683e03a40c0bbd88dadf6bb30121d41e944207c Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 20 Nov 2026 16:18:25 -0300 Subject: docs: PARDES_PAIR, what it is (pardes-pair-3's item 3e): docs/next-run.md a section (the experiment behind its variable, how to turn it on, kept and what `ps` says, the lifetime table as built: Detach, a close, a loss, no daemon, in the columns not kept and kept), docs/typ/running.typ the same as a section "An experiment: PARDES_PAIR" with the table (the book compiles with typst), core/CHANGELOG.md one entry (and the one change without the variable: a TERMed terminal client's goodbye and exit 0); `pardes help` says nothing of it yet Co-Authored-By: Claude Opus Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- docs/typ/running.typ | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'docs/typ') diff --git a/docs/typ/running.typ b/docs/typ/running.typ index 74eb8cbd..320b3130 100644 --- a/docs/typ/running.typ +++ b/docs/typ/running.typ @@ -205,6 +205,37 @@ daemon died is not: it starts the next one itself (#link()[below]) `pardes-gui` built for a Mac has no daemon either, but can still be a far client. += An experiment: `PARDES_PAIR` + +// runtime/main.zig pair (the fork); runtime/daemon.zig State, keepSession; +// core/replica.zig Peers.leave, Peers.detach; runtime/session.zig (the +// end); dev/tui/tui.zig runClient and winchWatch (HUP and TERM a close); +// dev/gui/gui.zig Input.close; runtime/upgrade.zig Record.state. +With `PARDES_PAIR=1` in its environment (`export PARDES_PAIR=1`; unset, +none of this happens), `pardes FILE` in a terminal and `pardes-gui FILE` +start the way every frontend will: the process you started forks a +session with no terminal or window of its own and is its first client, +the job your shell waits on. A session is _kept_ or not: kept from birth +when started with `pardes new --detach` (or `--detach`), and once a +#word("Detach") is typed in any of its clients; an #word("Upgrade") keeps +which. `pardes ps` says `(tty, kept)` of a kept session and `(tty)` of +one that is not. + +#{ + set text(size: 0.85em) + set par(justify: false) + table( + columns: (1.2fr, 1.6fr, 0.9fr), + stroke: (x, y) => if y == 0 { (bottom: 0.8pt) } else { (bottom: 0.3pt) }, + inset: (x: 4pt, y: 4pt), + table.header([*what happens*], [*not kept*], [*kept*]), + [#word("Detach") typed in a client], [it becomes kept; the client says so and exits 0], [the same], + [a window closed, a terminal closed, a TERM to a client], [the client says goodbye and exits 0, its terminal put back; the session ends if that was its last client], [it runs on], + [a client killed outright (KILL) or crashed], [it runs on, listed by `pardes ps`], [it runs on], + [no daemon], [it ends with its last client, whatever ended it], [cannot be: #word("Detach") refuses], + ) +} + = At a glance // The rows' sources are the sections above; `ps`: -- cgit v1.3