summaryrefslogtreecommitdiff
path: root/docs/next-run.md
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-20 18:08:49 -0300
committerGabriel Schneider <[email protected]>2026-11-20 18:08:49 -0300
commit4053e62a2aabd794db9075d93ebe57eec3f432a6 (patch)
treeb5a676e835b4df79f0670056a636410c97ffb8fd /docs/next-run.md
parente3d0daa9f89f41b41b7d05d510db553cbd8816d9 (diff)
parent6683e03a40c0bbd88dadf6bb30121d41e944207c (diff)
downloadpardes-4053e62a2aabd794db9075d93ebe57eec3f432a6.tar.gz
pardes-4053e62a2aabd794db9075d93ebe57eec3f432a6.zip
integration: a hang-up is a close and a session can be kept, on the 9P state a join carries: pardes-pair-3 (a session's state as the daemon hears it: attached, detached, pair or kept, carried through an Upgrade; a terminal client takes HUP and TERM itself and leaves with a goodbye that closes; ps shows (tty) for a pair and (tty, kept); the documents say what PARDES_PAIR is) and pardes-merge40, merged without a textual conflict; tui core-test 871/1028 (157 skipped), shell-test 1070/1073, term-test 17/17, both soaks diverged 0, unequal 0, unlisted 0, the window builds; the coordinator's gate in the ledger (reorg/merge41)
Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'docs/next-run.md')
-rw-r--r--docs/next-run.md27
1 files changed, 27 insertions, 0 deletions
diff --git a/docs/next-run.md b/docs/next-run.md
index c2d3488b..00890ef1 100644
--- a/docs/next-run.md
+++ b/docs/next-run.md
@@ -178,6 +178,33 @@ it). For the window's build the fork comes before SDL starts. Then
`pardes --detach=work` returns at once, `&` is not needed, and every
session in `ps` is either its stub's child or a process of its own.
+## `PARDES_PAIR`: every frontend a client (an experiment, built)
+
+With `PARDES_PAIR=1` in its environment (`export PARDES_PAIR=1` in a
+shell's rc; unset, nothing below happens), `pardes FILE` in a terminal and
+`pardes-gui FILE` start the way the last step's design has every frontend
+start: the process you started forks a session with no terminal or window
+of its own (`setsid`, `/dev/null`; a window's child execs the `pardes`
+beside it) and is its first client over a socket pair, the job your shell
+waits on (`runtime/main.zig` `pair`). A session is `kept` or not: kept from
+birth when started with `new --detach[=NAME]` or `--detach`, kept once a
+Detach is typed in any of its clients, never unkept, and an Upgrade
+carries it (`runtime/daemon.zig` `State`, the upgrade record's `state`).
+`pardes ps` says `(tty, kept)` of a kept session and `(tty)` of one that
+is not; a session with a frontend of its own still says `(tty, has a
+frontend)` and a detached one `(tty, detached)`. Its lifetime
+(`core/replica.zig` `Peers.leave`, `runtime/session.zig`):
+
+| What happens | Not kept | Kept |
+|---|---|---|
+| Detach typed in a client | it becomes kept; the client says "detached from 'NAME', which is still running" and exits 0 | the same |
+| a window closed, a terminal closed (its hangup), a TERM to a client | the client says goodbye with a close 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 | the link ends with no goodbye: it runs on, listed by `pardes ps`, attachable | it runs on |
+| no daemon | it ends when its last client's link ends, goodbye or not | cannot be: Detach refuses |
+
+Tested by `test/daemon.py --pair` (`pair`, `pair_rows`) and `--gui`
+(`gui_pair`).
+
## Rex beside pardes
From Rex's own help (captured under