summaryrefslogtreecommitdiff
path: root/docs/typ
diff options
context:
space:
mode:
Diffstat (limited to 'docs/typ')
-rw-r--r--docs/typ/building.typ16
-rw-r--r--docs/typ/builtins-gui.json4
-rw-r--r--docs/typ/builtins-tui.json4
-rw-r--r--docs/typ/cheatsheet.typ2
-rw-r--r--docs/typ/guide.typ2
-rw-r--r--docs/typ/reference.typ93
-rw-r--r--docs/typ/themes.typ2
7 files changed, 113 insertions, 10 deletions
diff --git a/docs/typ/building.typ b/docs/typ/building.typ
index cf80bd3a..f14c466b 100644
--- a/docs/typ/building.typ
+++ b/docs/typ/building.typ
@@ -121,8 +121,12 @@ package, and `zig build lib-test` builds and runs it.
```
zig build unit-test module and shell unit tests (the perf gate runs with it)
zig build test-build compile the unit-test programs without running them
-zig build core-test core tests without native shell tests
-zig build shell-test the native shell's own unit tests, without the perf gate
+zig build core-test core tests on the core without a terminal (no ghostty,
+ no C++): a shell boot is a scratch pane, and a test
+ that needs a terminal skips; the one to iterate on
+zig build shell-test the same tests and the native shell's, with the terminal,
+ without the perf gate
+zig build term-test the terminal module's own tests (src/term/)
zig build pane-test pane, output and namespace integration tests
zig build kitty-test kitty graphics conformance of terminal panes, at the core
zig build kitty-harness kitty graphics through a pane end to end (a fake kitty
@@ -238,6 +242,14 @@ effects such as spawning processes.
decides who serves it.
- The root module is chosen by platform: `main.zig` (tui, gui),
`macos.zig`. The macOS shell is a library whose host owns `main()`.
+- The terminal is a module of its own, `term` (`src/term/`): the
+ emulator (ghostty-vt), kitty images (wuffs, zstbi), the pager's parse
+ and the replicas' screen state. It never imports the core; the core
+ reaches it through one table of plain-data entries (`src/plain/term.zig`,
+ through `src/Term.zig`), chosen at compile time. The records both name
+ (cells, colours, keys) are `plain` (`src/plain/plain.zig`, std only).
+ Every product is built with the terminal; core-test's core is built
+ without it, so its compile names no ghostty, wuffs, zstbi or C++.
- `memory.limits` is the one home for the core's capacities (selections,
the tag's bytes, undo, the arenas' regions). Each core
allocator is a DebugAllocator over its arena's reserved region, thread
diff --git a/docs/typ/builtins-gui.json b/docs/typ/builtins-gui.json
index c7ff594f..8ed70b10 100644
--- a/docs/typ/builtins-gui.json
+++ b/docs/typ/builtins-gui.json
@@ -26,7 +26,7 @@
{"name": "Delcol", "leader": "SPC c d", "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Close this column and its panes, refusing once over unsaved text."},
{"name": "Detach", "leader": "SPC s D", "also": [], "arg": false, "scope": "root", "setting": false, "choices": null, "doc": "Detach this pardes from its terminal or window, leaving the session running: `pardes --attach` (or `pardes-gui --attach`) takes it back."},
{"name": "Diagnostics", "leader": "SPC l d", "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "List the file's diagnostics from the language server."},
- {"name": "Diff", "leader": null, "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Stack a diff's hunks as a diff viewer shows them, each under its place and the declarations around it, in a +Diff; on a +Diff, show the diff itself as text."},
+ {"name": "Diff", "leader": null, "also": [], "arg": true, "scope": "pane", "setting": false, "choices": null, "doc": "Stack a diff's hunks as a diff viewer shows them, each under its place and the declarations around it, in a +Diff; on a +Diff, show the diff itself as text."},
{"name": "Down", "leader": null, "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Move the keyboard to the pane below, off a tag onto the pane under it."},
{"name": "Dump", "leader": "SPC s d", "also": ["topbar"], "arg": true, "scope": "root", "setting": false, "choices": null, "doc": "Write the session's panes and layout to the state file, for Restore; `Dump export <path>` writes them to a file of their own instead."},
{"name": "DumpConfig", "leader": null, "also": [], "arg": false, "scope": "root", "setting": false, "choices": null, "doc": "Open the settings in effect, each a word to click, and the startup file's path."},
@@ -76,7 +76,7 @@
{"name": "Panes", "leader": null, "also": [], "arg": true, "scope": "pane", "setting": false, "choices": null, "doc": "Pick an open pane by its name in a query pane under this one (SPC b b)."},
{"name": "Pet", "leader": null, "also": [], "arg": true, "scope": "root", "setting": true, "choices": "off, cat, frog", "doc": "The window's companion in the workspace tag's blank space: off, cat or frog."},
{"name": "Petscii", "leader": "SPC t p", "also": [], "arg": true, "scope": "pane", "setting": false, "choices": null, "doc": "glyph art over the host's pixels: an image pane's picture, or the kitty graphics a terminal's program placed (yazi's previews)"},
- {"name": "Plumb", "leader": null, "also": [], "arg": true, "scope": "root", "setting": false, "choices": null, "doc": "The plumber's rules, for the session, one a line as plumb(6) orders a rule: `Plumb suffix .svg to image` makes a look at an existing `.svg` file an image pane."},
+ {"name": "Plumb", "leader": null, "also": [], "arg": true, "scope": "root", "setting": false, "choices": null, "doc": "Open the plumbing file, the plumber's rules (plumb(6)'s rule sets) in the configuration directory beside `init`: saved, they are the rules in force."},
{"name": "Putall", "leader": null, "also": [], "arg": false, "scope": "root", "setting": false, "choices": null, "doc": "acme's Putall: every pane holding unsaved edits to a file is saved, each as its own Save; one that is refused (changed on disk since, a write that fails) says so and the rest are saved all the same."},
{"name": "Recent", "leader": "SPC f r", "also": [], "arg": true, "scope": "root", "setting": false, "choices": null, "doc": "List the files opened lately, closed ones too, each a place to open again."},
{"name": "Redo", "leader": null, "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Redo the last undone edit."},
diff --git a/docs/typ/builtins-tui.json b/docs/typ/builtins-tui.json
index feb1140f..aa95d9a6 100644
--- a/docs/typ/builtins-tui.json
+++ b/docs/typ/builtins-tui.json
@@ -25,7 +25,7 @@
{"name": "Delcol", "leader": "SPC c d", "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Close this column and its panes, refusing once over unsaved text."},
{"name": "Detach", "leader": "SPC s D", "also": [], "arg": false, "scope": "root", "setting": false, "choices": null, "doc": "Detach this pardes from its terminal or window, leaving the session running: `pardes --attach` (or `pardes-gui --attach`) takes it back."},
{"name": "Diagnostics", "leader": "SPC l d", "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "List the file's diagnostics from the language server."},
- {"name": "Diff", "leader": null, "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Stack a diff's hunks as a diff viewer shows them, each under its place and the declarations around it, in a +Diff; on a +Diff, show the diff itself as text."},
+ {"name": "Diff", "leader": null, "also": [], "arg": true, "scope": "pane", "setting": false, "choices": null, "doc": "Stack a diff's hunks as a diff viewer shows them, each under its place and the declarations around it, in a +Diff; on a +Diff, show the diff itself as text."},
{"name": "Down", "leader": null, "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Move the keyboard to the pane below, off a tag onto the pane under it."},
{"name": "Dump", "leader": "SPC s d", "also": ["topbar"], "arg": true, "scope": "root", "setting": false, "choices": null, "doc": "Write the session's panes and layout to the state file, for Restore; `Dump export <path>` writes them to a file of their own instead."},
{"name": "DumpConfig", "leader": null, "also": [], "arg": false, "scope": "root", "setting": false, "choices": null, "doc": "Open the settings in effect, each a word to click, and the startup file's path."},
@@ -71,7 +71,7 @@
{"name": "Palette", "leader": "SPC t l", "also": [], "arg": true, "scope": "pane", "setting": false, "choices": null, "doc": "the C64 palette or the terminal's own 16"},
{"name": "Panes", "leader": null, "also": [], "arg": true, "scope": "pane", "setting": false, "choices": null, "doc": "Pick an open pane by its name in a query pane under this one (SPC b b)."},
{"name": "Petscii", "leader": "SPC t p", "also": [], "arg": true, "scope": "pane", "setting": false, "choices": null, "doc": "glyph art over the host's pixels: an image pane's picture, or the kitty graphics a terminal's program placed (yazi's previews)"},
- {"name": "Plumb", "leader": null, "also": [], "arg": true, "scope": "root", "setting": false, "choices": null, "doc": "The plumber's rules, for the session, one a line as plumb(6) orders a rule: `Plumb suffix .svg to image` makes a look at an existing `.svg` file an image pane."},
+ {"name": "Plumb", "leader": null, "also": [], "arg": true, "scope": "root", "setting": false, "choices": null, "doc": "Open the plumbing file, the plumber's rules (plumb(6)'s rule sets) in the configuration directory beside `init`: saved, they are the rules in force."},
{"name": "Putall", "leader": null, "also": [], "arg": false, "scope": "root", "setting": false, "choices": null, "doc": "acme's Putall: every pane holding unsaved edits to a file is saved, each as its own Save; one that is refused (changed on disk since, a write that fails) says so and the rest are saved all the same."},
{"name": "Recent", "leader": "SPC f r", "also": [], "arg": true, "scope": "root", "setting": false, "choices": null, "doc": "List the files opened lately, closed ones too, each a place to open again."},
{"name": "Redo", "leader": null, "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Redo the last undone edit."},
diff --git a/docs/typ/cheatsheet.typ b/docs/typ/cheatsheet.typ
index 5e373fac..e931effa 100644
--- a/docs/typ/cheatsheet.typ
+++ b/docs/typ/cheatsheet.typ
@@ -10,7 +10,7 @@
btn("B2"), [#word("Exec") the word or selection: a builtin, else a shell line.],
btn("B3"), [#word("Look"): open the file, address, directory or URL, else find the word's next place. Resting the pointer tints what #btn("B3") would take.],
[sweep], [drag #btn("B2") or #btn("B3") to #word("Exec") or #word("Look") exactly what you swept.],
- [grip], [drag the box left of a tag: up/down resizes, onto another column moves the pane. A column's right edge drags its width.],
+ [grip], [drag the box left of a tag: up/down resizes, onto another column moves the pane. A column's box: sideways resizes, past a neighbour's middle moves the column.],
)
=== Chords: hold the first, click the next
#pairs(
diff --git a/docs/typ/guide.typ b/docs/typ/guide.typ
index c602927d..6a50eef1 100644
--- a/docs/typ/guide.typ
+++ b/docs/typ/guide.typ
@@ -174,7 +174,7 @@ pardes.
addr("notes.txt:12"), [line 12],
addr("notes.txt:/TODO/"), [the next match of `TODO`],
addr("src/"), [a pane listing it, as acme's directory window: a #word("Look") at an entry opens it, `..` goes up, `Get` reads it again],
- addr("https://ziglang.org"), [the browser, through `xdg-open` (`open` on macOS); #word("Plumb") adds rules of your own],
+ addr("https://ziglang.org"), [the browser, through `xdg-open` (`open` on macOS): a plumbing rule's; #word("Plumb") opens your rules],
)
#key("Enter") does the same from the keyboard; the other address forms are
diff --git a/docs/typ/reference.typ b/docs/typ/reference.typ
index 7360179f..987f9f9b 100644
--- a/docs/typ/reference.typ
+++ b/docs/typ/reference.typ
@@ -38,6 +38,10 @@ addons the kinds of pane here, compiled in or an addon's @add
layout a line per column, then active <serial> @columns-and-tags
tag the workspace tag @columns-and-tags
tagexec a word clicked in the workspace tag @columns-and-tags
+plumb/ the plumber's: plumb(6) rules, and messages sent by them @plumber
+ rules the rules in force; a write adds rule sets, > replaces them @plumber
+ send write a message: six header lines, then its data @plumber
+ <port> a port the rules name: read, the messages sent to it @plumber
col/ the columns @columns-and-tags
<n>/ column <n>; rmdir closes it when empty @columns-and-tags
tag its tag
@@ -64,6 +68,7 @@ pane/ the panes @pa
look a #word("Look") at this pane @look-and-exec
exec an #word("Exec") at this pane @look-and-exec
tagexec a word clicked in this pane's tag @look-and-exec
+ rows a line a row: where it points, how it is coloured (README) @panes
pty/ terminals only @pty
ctl winsize, sig, exec @pty
status cols rows busy @pty
@@ -1015,6 +1020,92 @@ at 200, ending in `…`. Control characters become spaces.
synthetic. Linux v9fs's truncation `mtime` hint is accepted and dropped.
- #file("/src/") with `-Dembed-sources=true`.
+= The plumber <plumber>
+
+Plan 9's plumber(4), its language plumb(6)'s, in the session: rules
+match a message and say where it goes. A #word("Look") asks it first, as
+acme's does: after the pane's own readings (a +History or +Recent row, a
+diff line, a command word, `file:/re/`) and once a name already open in a
+pane is focused (never sent), what is looked at is sent, `type` `text`,
+`src` `pardes` (`term` from a terminal's raw mode, a kind's name from its
+pane), `wdir` the pane's directory, the data the name as Look reads it.
+One that no rule set takes, or that a started word declines, is Look's
+own: a file or directory opened, else the word searched for.
+
+- #file("/plumb/rules") reads the rules in force: rule sets of
+ `object<tab>verb<tab>arg` lines, each set ended by a blank line, a
+ variable's `name=value` where it was set, an `include`'s rules in its
+ place. A session starts with the plumbing file's rules, #word("Plumb")
+ (`plumbing` in the configuration directory, beside `init`; saved, its
+ rules are in force), or without one `include basic`, pardes's own
+ (`src/plumbing`, below). A write adds rule sets, each
+ read as its blank line comes, the rest at the close (refused there, it
+ is an `err` in the log alone; Plan 9's loses it); `>` replaces them
+ all. One open writes at a time (`file in use`). Kept in a dump.
+- A rule set that does not read is refused at the write it is whole in,
+ `plumb/rules:<line>: <why>` in rules.c's words (`unknown verb isnt`,
+ `ruleset must have patterns and actions`), and the rules stay as they
+ were. `$1`-`$9` are refused: pardes's regular expressions
+ (#doc("reference", section: "regexp")) have no submatches; write `$0`
+ and several `matches`, as Pike's two patterns do. `include basic` is
+ `src/plumbing`; another name is the configuration directory's file, an
+ absolute one where it says.
+- #file("/plumb/send") takes a message, plumb(6)'s six lines (`src`,
+ `dst`, `wdir`, `type`, `attr`, the data's length) and then the data,
+ in one write or several. The write is answered once it has gone where
+ the first rule set whose patterns hold says, or refused in Plan 9's
+ words: `bad plumb message format`, `couldn't find destination for
+ message` (no rule set takes it and it names no port), `no start action
+ for plumb message`, `no port for "client" rule`.
+- The verbs are plumb(6)'s: `is`, `matches` (the whole text; with
+ `click=N` in `attr`, the run around rune N, and the data cut to it),
+ `isfile` and `isdir` (a name found as #word("Look") finds one: past the
+ place written after it, in `wdir`, then #word("Incl")'s directories;
+ `$file` and `$dir` are where), `set`, `add` and `delete` (`delete` of
+ an attribute not there fails, as plumber's code does), and the actions
+ `plumb to <port>`, `plumb start <words>` and `plumb client <words>`.
+- Each port a rule has named this session has a file,
+ #file("/plumb/<port>") (0444), listed after `rules` and `send` in the
+ order the rules named them, never dropped. An open of it reads the
+ messages sent to that port from then on, one a read in the six lines'
+ form, a read that finds none held until one comes; every open gets its
+ own copy (`cat /plumb/edit` beside the editor sees every look it opens),
+ a message over its 64 KiB queue is not sent to it (an `err` in the log
+ says so). Messages sent before the open are not its.
+- The ports pardes reads itself, whatever else reads them: `edit` (the
+ data opened as a #word("Look") opens it, at `addr=` when given; with
+ `action=showdata` the data itself shown, as acme's `plumb -i`, in the
+ pane `filename=` names, else a new clean one of that name, and with
+ `action=showdiff` then stacked in a +Diff in its place), `web`
+ (the host's browser, a URL of at most 256 bytes) and each loaded kind by
+ its name (`image`, `pdf`). A message to another port goes to its
+ readers; with none, its rule set's `start` runs (the message dropped),
+ or its `client`, the message held for the port's first reader (the
+ program it started, as a rule's `plumb client` means). To a port no
+ rule ever named it goes nowhere.
+- `plumb start` of a builtin or a kind's word runs it in place, at the
+ looking pane (the pane with the keyboard for a #file("/plumb/send")
+ message); one that cannot do what it is asked declines, saying
+ nothing, and the send is refused (`no matching plumb rule`), so a
+ #word("Look") looks itself. Any other word is a program, started as
+ Plan 9's plumber starts one: detached, no pane, stdin, stdout and
+ stderr `/dev/null`, its words exec'd in `wdir` with no shell (a rule
+ that wants one says `sh -c '...'`); a failure to start it is said, and
+ logged as an `err`. Its directory and words fit in 256 bytes.
+
+The default rules, `src/plumbing`, keep #word("Look")'s ways: a URL to
+the browser; a bare `.diff` or `.patch` stacked in a +Diff (#word("Diff")
+with the file, which declines one with no hunk, opened as text then); an
+existing directory or file to `edit`, Look's own open (a kind's file in
+its kind); a commit hash looked at in the editor, in a git work tree, to
+#word("Diff") with it, `git show` paged (outside one, Diff declines and
+the word is searched for); a diff paged into a +Pager, which the pager
+sends to `edit` (`src` `pager`, `type` `text/x-diff`, `action=showdata`
+and the +Pager's `filename`), made `showdiff`: stacked in a +Diff in the
++Pager's place. Text paged that is no diff is not sent:
+
+#raw(read("../../src/plumbing"), block: true)
+
= Addons <addons>
An addon is a shared library that brings one kind of pane: a picture, a
@@ -1352,7 +1443,7 @@ with Client(sys.argv[1]) as c: # a socket path, or (ip, port)
[Edit], [every acme command but `B <cmd`, `D <cmd` and the `'` address; no `\1`-`\9`, and an alternation takes the first branch that matches, not the longest; a failing `< | >` command changes nothing, where acme puts in what it wrote (#doc("fs", section: "edit"))],
[`win`], [#word("Term") is a VT terminal pane; #file("pty/run") runs a line at its prompt and answers `exit N` and the output; with #word("Repl") bound, #word("Exec") on a source pane types the text into it],
[a directory window], [as acme's: a text pane named `dir/` (#file("index") kind `text`, #file("ctl") isdir 1), its entries in columns sorted bytewise, dotfiles shown, a directory's marked `/`; blanks pad the columns where acme's tabs do; a #word("Look") at an entry is from that directory, `Get` or a look at it again reads it again, and an edit is kept until then rather than lost to a resize; never dirty, #word("Save") refuses it],
- [the plumber], [no process: #word("Plumb") rules, one a line in plumb(6)'s order (`Plumb suffix .svg to image`), for the session and kept in a dump, are tried before the built-in ones and the first that matches takes the #word("Look"); the tests are `prefix`, `suffix` (an existing file's name, any case), `isdir` and `isfile`, the ports `url` (`xdg-open`, `open` on macOS), `dir`, `file` and any loaded kind by its name (`image`, `pdf`): a rule naming a kind not loaded is refused, and one whose kind has gone since is passed over; no `matches`, attributes, variables or `include`; bare, #word("Plumb") lists the rules, `Plumb -` empties them; the user's own go in `init`, a `Plumb` line each; the built-in rules: an `http://` or `https://` URL to `url`, a directory, a kind's extensions, then any file],
+ [the plumber], [no process: the plumber is the editor's own (#doc("reference", section: "plumber")): plumb(6)'s rules in #file("/plumb/rules") and the plumbing file #word("Plumb") opens, messages to #file("/plumb/send"); no submatches (`$1`-`$9`), no `click` from a #word("Look") (its own expansion stands)],
[#key("Esc") selects what was typed], [#key("Esc") leaves insert mode, or goes back a pane (#doc("tags", section: "modes"))],
)
diff --git a/docs/typ/themes.typ b/docs/typ/themes.typ
index 97b42748..a78cf66c 100644
--- a/docs/typ/themes.typ
+++ b/docs/typ/themes.typ
@@ -109,7 +109,7 @@ take `null`, so older files stay valid:
[`tag_active_bg`, `tag_active_fg`], [the focused pane's tag; a ground closer than 1.25:1 to `tag_bg` is pushed further the way it leans, as far as its text keeps its contrast. Absent: `tag_bg`, `tag_fg`],
[`tagline_bg`, `tagline_fg`], [the tagline, the workspace row: an editor's status bar in its own colours (`dark_plus` has VS Code's blue). Absent: the tag's],
[`tag_name_fg`, `tag_active_name_fg`], [the file name's or a terminal's #word("Term") tint, in normal and focused tags. Absent: the tag's foreground],
- [`column_box`, `column_box_dim`], [a column's grip held (and its drag rail), and at rest. Absent: `num`; a mix of `column_box` and `tag_bg`],
+ [`column_box`, `column_box_dim`], [a column's grip held, and at rest. Absent: `num`; a mix of `column_box` and `tag_bg`],
[`border`], [quiet separators, lifted to 1.6:1 when under 1.5:1 off the page. Absent: `scroll_track`],
[`empty_col`], [a column with no pane, under its tag (acme: white). Absent: `border`],
[`lineno_active`], [the current line number. Absent: `lineno`],