diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/next-daemon.md | 9 | ||||
| -rw-r--r-- | docs/next-drag.md | 6 | ||||
| -rw-r--r-- | docs/next-run.md | 27 | ||||
| -rw-r--r-- | docs/search-proto-converge.md | 8 | ||||
| -rw-r--r-- | docs/typ/building.typ | 5 | ||||
| -rw-r--r-- | docs/typ/command-line.txt | 10 | ||||
| -rw-r--r-- | docs/typ/running.typ | 31 |
7 files changed, 78 insertions, 18 deletions
diff --git a/docs/next-daemon.md b/docs/next-daemon.md index 37ba0241..9ed25f9c 100644 --- a/docs/next-daemon.md +++ b/docs/next-daemon.md @@ -710,9 +710,10 @@ Decisions taken at the forks, with the ponytail lens: - **Clock.** `advance`'s wakes are the recording session's (`tape.value(.wake, nextWake)`): a picture decoding or a fade asks a frame, and a replica that draws none must still take the session's - ticks. The budgets of Places, Names and Tables are taped verdicts - (`tape.over`), as are a message's time of day (TZ included), File.mtime - and the pump's clock read (made whether or not it waits). A message's + ticks. The budgets of Places and Names are counts (bytes read, the + scorer's cells), the same on every side, never the clock's verdict + (P27, P30). A message's time of day (TZ included), File.mtime + and the pump's clock read (made whether or not it waits) are taped. A message's stamp and an unattended session's expiry of it read the clock through the tape too, not the session clock: that is the last pump's, and stamped by it a message written over 9P after an idle spell was as old @@ -1443,7 +1444,7 @@ dump hooks; `pardes-snap --dump`, `pardes-monkey --dump`, and both in Handover's dump in flight and its carrier, and the host's fallback file table are authority: host errands, not state. - **Restore keeps serials.** Renumbering would rewrite every serial the - session holds (attachments, query owners, places, messages, LSP and + session holds (docked panes, query owners, places, messages, LSP and callstack requests); Restore hangs up every connection anyway. The next serials are past the old session's; `restored`/`restoredcol` records are gone. A Restore over an older session keeps the host's facts (cell diff --git a/docs/next-drag.md b/docs/next-drag.md index 47ccdb0b..dd2f24ed 100644 --- a/docs/next-drag.md +++ b/docs/next-drag.md @@ -43,7 +43,7 @@ window it goes to is found by asking every registry session. grip) released outside goes to `Handover.begin` instead of the layout move. Inside the window the grip drag is exactly as before. - `core/Handover.zig` (`Pardes.handover`), the core half: the pane with the - panes attached to it (an attachment dragged alone goes alone, unattached), + panes docked to it (a docked pane dragged alone goes alone, undocked), or the column, is dumped alone: `dump.dumpBytes(p, keep, carried)`, which `dumpState` now calls with no mask; `State.carried` (`pane`/`column`) marks such a dump. Each carried pane's serial and `File.revision` is @@ -61,7 +61,7 @@ window it goes to is found by asking every registry session. - `Handover.finish`: taken, each carried pane is closed with `Pardes.removePane` (Del's rows rule: its rows go to its neighbour; a carried column's empty column is dropped); a pane whose revision changed - since the dump is kept, unattached ("copied to …; edited on the way, kept + since the dump is kept, undocked ("copied to …; edited on the way, kept here too"). Refused or failed: everything stays, the reason on the message row. One handover flies at a time. - New option `--geometry=WxH[+X+Y]` (runtime/main.zig, `Options.geometry`). @@ -80,7 +80,7 @@ window it goes to is found by asking every registry session. dumped panes into free slots and places them where the pointer is: a pane goes right under the group the pointer is over, out of that group owner's rows alone (the owner keeps its rows down to the pointer's row; - over one of its attachments, half); a column goes beside the column the + over one of its docked panes, half); a column goes beside the column the pointer is over, out of that column's width alone (`insertColumn`). Every other pane's rect is unchanged (tested). The ctl write is answered after the panes are in, so the source closes its pane only once the target has 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 diff --git a/docs/search-proto-converge.md b/docs/search-proto-converge.md index da336f7c..3af49a06 100644 --- a/docs/search-proto-converge.md +++ b/docs/search-proto-converge.md @@ -2,11 +2,11 @@ The design the twelve prototypes added up to (CONVERGE.md), built as the product in six changes. One pane kind does all searching: the **query -pane**, a `+Search` attached under the pane that asked (its *owner*), whose +pane**, a `+Search` docked under the pane that asked (its *owner*), whose body's line 1 is the query, typed into, and whose rows below are made live from a source. The owner shows the set in its own text (its **places**: tints, rail ticks, the current one selected), and a row that points at a -file no pane shows is shown in a **+Preview** attached under the query +file no pane shows is shown in a **+Preview** docked under the query pane. Everything on screen is text in a pane: B1/B2/B3 and the chords work on all of it, nothing is drawn over anything, and the notice band keeps only the prompts that are not search. @@ -15,7 +15,7 @@ only the prompts that are not search. | piece | file | lifted from | |---|---|---| -| attached panes: a group under its owner, rows from the owner alone, moving/folding/closing with it, seam drag, Dump/Restore, `Undock` | `core/layout.zig` "Attached panes", `Pane.docked_to` | attached | +| docked panes: a group under its owner, rows from the owner alone, moving/folding/closing with it, seam drag, Dump/Restore, `Undock` | `core/layout.zig` "Docked panes", `Pane.docked_to` | attached | | places: every match tinted, rail ticks (B1 on a tick goes there), current selected and in view, smart-case regex, view-first sliced scan, silent wrap | `core/Places.zig`, `Pane.places` | incsearch (MatchSet) | | the query pane: line 1, its first word the source, live rows, preview, Enter/Esc/Del, reuse, settings | `core/Query.zig`, `Pane.query` | queryline, pick, live, preview, everywhere | | fuzzy names (files, recent, panes, declarations) | `core/Names.zig` | pick (its scorer, whole) | @@ -113,7 +113,7 @@ tint (`Query.paintMark`), no selection: a click, a sweep or a chord never erases it and B2 / B3 on it take the word clicked, as on any row. **Enter** puts the keyboard on the current hit in its pane (the +Preview -promoted in place: same slot, serial, rect, an unattached file pane from +promoted in place: same slot, serial, rect, an undocked file pane from then on), fills `/`, and freezes the rows into ordinary text (tag ` Save Undock Del`). A `/` freezes its whole list (every place found first, 2000 rows at most), a Grep every line it has. **Esc** while typing puts every diff --git a/docs/typ/building.typ b/docs/typ/building.typ index d4732fa9..94939452 100644 --- a/docs/typ/building.typ +++ b/docs/typ/building.typ @@ -129,7 +129,7 @@ Every dependency but tree-sitter's runtime is lazy in the manifest, so such a package fetches what it asked for and nothing else. `pardes-editor` has `pardes-syntax` in it as `.syntax`: a file belongs to one module, so a package imports one of the two. `test/consumer` is -such a package, with both shapes; `lib-test`, which `unit-test` runs, +such a package, with both shapes; `consumer-test`, which `unit-test` runs, builds and runs it. `build.zig.zon` names pardes by its path: `.pardes = .{ .path = "../pardes" }`. @@ -197,9 +197,8 @@ zig build kitty-test kitty graphics conformance of terminal panes, at the zig build kitty-harness kitty graphics through a pane end to end (a fake kitty terminal outside on the tui, the GPU capture on the gui; kitten icat and chafa too when installed) -zig build syntax-test tree-sitter tests without building the editor zig build syntax deterministic per-byte highlighting snapshots -zig build lib-test the library, from a package that depends on pardes (test/consumer); +zig build consumer-test the library, from a package that depends on pardes (test/consumer); unit-test runs it too zig build hxlib helix's cases on the library's editor (-- --parity: against the file pane) zig build behaviour-test behaviour through the 9P tree, in process (test/behaviour/), diff --git a/docs/typ/command-line.txt b/docs/typ/command-line.txt index 0ced145f..2f7753e4 100644 --- a/docs/typ/command-line.txt +++ b/docs/typ/command-line.txt @@ -39,10 +39,12 @@ The old spellings --ps, --attach[=NAME], --kill=NAME, --kill-all, -h and == pardes help ps 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). +(tty or gui) and whether it has a frontend of its own or is detached +(under PARDES_PAIR: kept, or nothing when its last client's close +ends it); 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, and a pair's not kept says pair). Usage: pardes ps 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(<run-survives>)[below]) `pardes-gui` built for a Mac has no daemon either, but can still be a far client. += An experiment: `PARDES_PAIR` <run-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 <run-glance> // The rows' sources are the sections above; `ps`: |
