From f41599385cc0ee990954b32eca79984d54d0c5e3 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 08:25:27 -0300 Subject: The docs: data writes replace their range, restored command panes show their exit, the tag's default words, empty matches at #0, errors' fallback, tagexec and event readers, Find finds names Dogfood round 18 found these false: `>>` on data replaces the addressed range (acme's data write deletes then inserts); a restored command pane shows the `exit N` it ended with; the default tag words are `Save Tty Collapse Del`; `file:0/^/` passes over the empty match at #0; `errors` with no room logs msg records; a pane's tagexec never goes to an event reader; a scratch is named with `(pane N)` in a refusal; and /commands said Find searched the pane, where it finds file names. Co-Authored-By: Claude Opus 5.5 --- .agents/skills/pardes-9p/SKILL.md | 3 ++- docs/fs.md | 32 +++++++++++++++++++++----------- src/builtins.zig | 2 +- 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/.agents/skills/pardes-9p/SKILL.md b/.agents/skills/pardes-9p/SKILL.md index 7f33937f..afdf3a4b 100644 --- a/.agents/skills/pardes-9p/SKILL.md +++ b/.agents/skills/pardes-9p/SKILL.md @@ -191,7 +191,8 @@ is followed by two, its argument and where it came from; write all three back as read (one write or three) and it runs once with its argument. `Tty`'s argument is a shell (`Tty fish`), and `Tty` on a pane's ctl opens a new terminal pane. After a Restore, panes have new serials (`restored ` in the log), a -command pane shows `exit ?` and does not run again, and REPLs are unbound. Multi-line code +command pane shows how it ended, `exit N` (`exit ?` if it was still running when +dumped), and does not run again, and REPLs are unbound. Multi-line code written to `pty/data` should be a bracketed paste, `\e[200~\e[201~`, then, in a separate write once the REPL has echoed the paste (Python 3.13+ takes a `\r` read with the paste as part of it, even for one line), `\r`. diff --git a/docs/fs.md b/docs/fs.md index b4c006d3..cfc8e656 100644 --- a/docs/fs.md +++ b/docs/fs.md @@ -180,7 +180,9 @@ through a `ctl` write or a click: first one `/log` record per pane, `unsaved `, then the write fails with one line that is never a list cut short, `: Modified (Exit again to discard)` for one pane, `4 unsaved panes: Modified (Exit again to discard)` for more, and -the `err` record says the same; each pane's message row names it. Restore, +the `err` record says the same; each pane's message row names it, a +`+New` scratch with its serial, as scratches share a name: `/dir/+New +(pane 12): Modified (Exit again to discard)`. Restore, Del and Delcol refuse the same way, with their own word; an `Exit` after more editing refuses again naming only the panes edited since the last refusal, as acme's does, and an `Exit` with nothing edited since quits, throwing all of it away; a scratch or a @@ -202,8 +204,9 @@ log names the restored panes and `restore `. Restored panes have new serials (`restored ` maps them) and so may columns (`restoredcol`; a fresh editor counts column serials from 1 again, so they often come back the same). A command -pane comes back showing what it showed, its tag `exit ?`: its command is -not run again. REPL bindings are not dumped. The answer has 200 ms to leave before the cut, so a slow +pane comes back showing what it showed, its tag saying how it ended, +`exit 0` (`exit ?` for one still running when dumped, whose end nobody +saw): its command is not run again. REPL bindings are not dumped. The answer has 200 ms to leave before the cut, so a slow client may see only the cut; the log's `restore ` is what says the Restore happened. Keeping connections across it would mean carrying serials and opens into the new editor, which acme, whose Load only adds windows, @@ -496,6 +499,9 @@ opens (or finds) the file and selects what the address names. **The address is evaluated from the file's dot**, as acme's is: `file:/re/` finds the next match after the current selection, not the first in the file. For the first, start at the top: `file:0/re/` (or `file:#0/re/`). +A pattern that can match empty, such as `^`, passes over the empty match +at #0 as sam does (a search never answers where it started), so it finds +the next one: for the start itself write `file:0` or `file:#0`. `:addr` does the same in the pane itself, and a pattern may hold blanks (`calc.py:/return a/`). `file:12` selects line 12, its newline included, as acme's does; `file:12:5` puts the caret at line 12, column 5. A bare @@ -522,10 +528,13 @@ lines: a row the terminal wrapped is joined back to the row before it (the wrap is ghostty's, as `pty/run`'s output unwraps), and the last line ends with a newline. `sel` reads the selected text and writing it replaces the selection. `errors` -appends to the directory's `+Errors` pane. Holding `event` open redirects the +appends to the directory's `+Errors` pane; with no room for that pane in +any column, what it would have shown is logged as `msg` records instead, a +line each, and the write still succeeds. Holding `event` open redirects the pane's Look and Exec clicks to that client, and so does a line written to the pane's own `look` or `exec`, or to the root's while that pane has the -keyboard, a click with no place in the text: an `F` record at `0 0` carrying +keyboard (never its `tagexec`, which is a click in its tag and runs), a +click with no place in the text: an `F` record at `0 0` carrying the line. So a client holding `event` that wants a command run gets its own exec back as a record: it runs it through `ctl`, or writes the record back. Writing a record back performs the action, as the click would have (acme's @@ -610,11 +619,12 @@ column a tool gives in characters (pytest's, a compiler's) is the same only on an ASCII line; elsewhere address the line and search it (`12/name/`) or use `#n`. sam would read `12:5` as a syntax error. -Truncating `data` or `xdata` deletes the range `addr` names and nothing -else, so a shell's `echo NEW > data` replaces that range, `: > data` -deletes it, and `>>` inserts at it; only truncating `body` empties the -whole buffer. Truncating `data` is pardes's own: acme ignores OTRUNC there -(editors/acme/fsys.c:543) and every write inserts. And as in acme a write +A write to `data` or `xdata` replaces the range `addr` names, as acme's +does (editors/acme/xfid.c:491-523: it deletes the range, then inserts), so +`echo NEW > data` and `echo NEW >> data` both replace that range, and +truncating deletes it and nothing else, so `: > data` deletes it; only +truncating `body` empties the whole buffer. Truncating `data` is pardes's +own: acme ignores OTRUNC there (editors/acme/fsys.c:543). And as in acme a write leaves `addr` just past what it wrote, so a second `echo x > data` deletes the empty range there and inserts after the first rather than replacing it again; write `addr` before each replacement. A read of `data` or `xdata` @@ -707,7 +717,7 @@ page (no mark for unsaved text: the grip shows that, and `dirty` says it), then the text you may edit. A write appends to that text, newlines included, and a tag with more than one line takes a row per line on screen; truncating `tag` clears it, as acme's `cleartag` does -- the default -words (`Del`, `Put` and the rest) with it, since they are that text until +words (`Save Tty Collapse Del` and the rest) with it, since they are that text until you edit it, so `echo Make > tag` leaves only `Make` -- a truncating write drops the one newline that ends what it wrote, which would draw an empty row, and keeps any other; append with `>>` to diff --git a/src/builtins.zig b/src/builtins.zig index 095eadbd..756eeae7 100644 --- a/src/builtins.zig +++ b/src/builtins.zig @@ -1322,7 +1322,7 @@ pub const Mini = struct { // ---- search ---- -/// List every place a pattern matches in the pane, in a +Search. +/// List the files below this pane's directory whose names hold its argument, in a +Search. pub const Find = struct { pub const takes_arg = true; pub const requires_arg = true; -- cgit v1.3