From a6c258bec5808ac2b6ef9d3362134e34e759c1c9 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 20 Nov 2026 03:20:39 -0300 Subject: docs: an attach is always a client, and a session registers again with a restarted daemon, in the documents: the manual's "How pardes runs" (docs/typ/running.typ: one Attach section, its figure of the in-place attach deleted from figures.typ, the glance and survival tables, the words), the guide's Sessions, the reference's /sessions and command line, the building chapter's daemon, the cheatsheet's line, `pardes help attach` (runtime/main.zig, docs/typ/command-line.txt from builtins-json), the Detach word's doc (core/builtins.zig, both builtins JSONs), docs/next-run.md as built (what went, counted on the change: 305 lines deleted, 94 added; the re-registration as built; --detach forking still not) with its figure (Before / Now), and the changelog's Unreleased; the book and the cheatsheet render (typst), tui shell-test 1046/1049 (3 skipped), core-test 855/1005 (150 skipped: the base's 856/1006 less the deleted `find` test) Co-Authored-By: Claude Opus Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- docs/typ/building.typ | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'docs/typ/building.typ') diff --git a/docs/typ/building.typ b/docs/typ/building.typ index 9350b484..8bfcb85b 100644 --- a/docs/typ/building.typ +++ b/docs/typ/building.typ @@ -501,10 +501,13 @@ life; the first session that finds none starts it (a double fork and an exec) and it exits a second after it holds nothing. It is nobody's parent: a session registers on one connection, sends it a dup of every pty master it forks (so a session killed outright never hangs its shells up, and -#word("Adopt") takes them into another), says whether a terminal or a -window shows it, and is handed a terminal (`pardes --attach`) or a window -request (`pardes-gui --attach`) through it. Messages are `SOCK_SEQPACKET` -datagrams: a line of words and the fds it carries. +#word("Adopt") takes them into another), says whether it has let its own +terminal or window go, and is handed each client's connection through it +(`pardes attach`, below). A daemon that dies is started again by the +sessions: each one's link's reader, woken by the link's end, dials the +next, says the hello again and tells it its masters and its clients. +Messages are `SOCK_SEQPACKET` datagrams: a line of words and the fds it +carries. `pardes` in a terminal forks its session off before anything starts: the session, in a session of its own (`setsid`), draws on the terminal it @@ -512,9 +515,9 @@ opened, and the process the shell waits on stays as its stub, passing it `SIGWINCH`, `SIGTERM`, `SIGINT` and `SIGQUIT` and ending with its status. #word("Detach"), or the terminal's end (EIO, a hangup), puts the terminal back and lets it go; the stub ends (exit 0) and the session -runs on with nothing drawn, until `pardes --attach` hands it another -terminal. A window's #word("Detach") closes the window and keeps the -process; `pardes-gui --attach` opens one again. `PARDES_DAEMON=off` (the +runs on with nothing drawn, detached for good: `pardes attach` is a client +of it. A window's #word("Detach") closes the window and keeps the +process, the same. `PARDES_DAEMON=off` (the process tests) runs a session as before the daemon: in the terminal's own process, ended by its hangup. -- cgit v1.3