summaryrefslogtreecommitdiff
path: root/src/fs-help.txt
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-21 20:07:43 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:14 -0300
commit9070942b29bd10dddcdecdb0e88ba0fb40608467 (patch)
treefa1fc5984c7847c52bf4e78d277586edce2d8325 /src/fs-help.txt
parent0122e94fb37422085325f2dc78ca015051ce5f91 (diff)
downloadpardes-9070942b29bd10dddcdecdb0e88ba0fb40608467.tar.gz
pardes-9070942b29bd10dddcdecdb0e88ba0fb40608467.zip
Plan 9 idiom for the control filesystem, and the regressions a624a56 left
The 9P tree stops being a command language wearing a filesystem. /new created a pane as a side effect of a *read*; it is now Tcreate in /pane, with Tremove to close, which cloud9's engine has always supported and the editor never declared: tree.zig now says `features = .{ .create = true, .remove = true }`. Eleven pane ctl verbs become files that can be read as well as written -- dot, limit, dirty, mark, scroll, look, exec -- leaving ctl with `get`, the one verb no file would say better. Root /ctl splits into a read-only /status and the /look and /exec files whose write IS the click. stat carries real sizes where it used to answer 0, and qid versions track a pane's revision, so a client can poll for change without re-reading the body. Commit a624a56 moved raw-tty keys to an early-return branch that knew only Ctrl-B and bare Escape, and in the same edit deleted the paste branch below it. That cost Shift-Escape (the unconditional way out of tty mode) and both paste chords: Ctrl-V and Ctrl-Shift-V reached the child as keystrokes, so an agent CLI running in a pane took Ctrl-V for its image-paste binding and answered "No image found in clipboard". Both are restored, with tests. Nested detection was not subtly broken but deleted: 60367d8 removed nested.zig's process-ancestry walk and left "am I inside pardes" derived from PARDES_FORWARD_LOOK, which read "0" both for --nested and for "the listener did not come up". PARDES_PID now answers that question on its own, checked with kill(pid, 0); PARDES_9P and PARDES_PANE answer how to reach it; the flag is gone. The posted-9P registry also self-heals now -- a session that aborts cannot unlink its own socket, so posting sweeps entries whose target refuses a connection, symlinks only and on a definite ECONNREFUSED only. Elsewhere: tty scrolling is sticky-bottom, following new output only from the last row, with typing and entering raw mode snapping back to live; the boot layouts are a Boot enum instead of a chain of ifs, and the bare tty startup (Boot.tty, which main.zig names) opens an empty text pane under the shell while tests keep Boot.tty_shell; builtins announce themselves on the message row under a Verbose setting that is on by default; Config prints each setting the way you would type it back, so WindowOpacity 70 rather than "WindowOpacity: 70%"; LocationsConfig opens its window only when called bare; every tagline puts the word that closes the thing last, and a column now outlives its panes -- closing the last one leaves an empty pane, and only Delcol, newly on the column tagline, takes the column away. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Diffstat (limited to 'src/fs-help.txt')
-rw-r--r--src/fs-help.txt42
1 files changed, 22 insertions, 20 deletions
diff --git a/src/fs-help.txt b/src/fs-help.txt
index a0a84b28..1e5d64c2 100644
--- a/src/fs-help.txt
+++ b/src/fs-help.txt
@@ -2,41 +2,43 @@ Pardes control filesystem
=========================
README this guide
index one line per pane: serial, kind (text|term|pdf|image), dirty flag, name
-ctl write commands; read the serials the last command made or touched
-new reading it creates one empty pane and answers its serial
+status pid, version and pane count
+look write a line: a right click on it at the active pane; read: the serials it touched
+exec write a line: a middle click, an editor command word or a shell line; read the same
log one line per editor event (new/del/rename/save <serial> <name>); reads wait
screen rendered screen as JSON, frozen from open to close
listeners the session's dial addresses
-pane/<n>/ name body tag ctl addr data xdata sel errors event, and pty/ for terminals
+pane/ mkdir makes a pane, rmdir <serial> closes it
+pane/<n>/ name body tag ctl addr dot limit data xdata sel dirty mark scroll
+ errors event look exec, and pty/ for terminals
os/ the host filesystem
src/ the editor's own sources, only in a -Dembed-sources=true build
-Commands, on /ctl (applied at the active pane) or on pane/<n>/ctl (at that pane):
- look TEXT a right click: open a file, a file:12 location, a directory, a URL
- exec TEXT a middle click: an editor command word (Save Del New Newcol Mount Unmount
- Dump Restore Msg Find Grep Tty ...), or a shell command for the pane's terminal
Below, $m is the mount point (PARDES_MOUNT in a Tty9p shell; 9ns and 9p work too):
cat $m/index which panes exist
- n=$(cat $m/new) make a pane, remember its serial
- echo 'look /etc/hosts:3' > $m/ctl; cat $m/ctl open a file, see the pane it went to
- printf 'text\n' > $m/pane/$n/body append to a pane (>| truncates first)
+ mkdir $m/pane/x; n=$(awk 'END{print $1}' $m/index) make a pane, take its serial
+ echo /etc/hosts:3 > $m/look; cat $m/look open a file, see the pane it went to
+ printf 'text\n' > $m/pane/$n/body append to a pane (>| truncates first)
cat $m/pane/$n/name; echo notes.txt > $m/pane/$n/name read, then rename
- echo 'exec Save' > $m/pane/$n/ctl save it (exec Del closes it)
- echo 'exec Msg hello' > $m/ctl show text in the editor
+ echo Save > $m/pane/$n/exec save it; rmdir $m/pane/$n closes it
+ echo 'Msg hello' > $m/exec show text in the editor
echo '#0,#5' > $m/pane/$n/addr; echo NEW > $m/pane/$n/data replace bytes 0..5
- echo 'dot=addr' > $m/pane/$n/ctl; cat $m/pane/$n/sel select the range, read it
+ cp $m/pane/$n/addr $m/pane/$n/dot; cat $m/pane/$n/sel select the range, read it
+ cat $m/pane/$n/dirty; echo 0 > $m/pane/$n/dirty is it modified? say it is not
cat $m/log block until a pane is made, renamed, saved or closed
cat $m/pane/$n/event hold it open to own that pane's clicks
- echo 'exec' > $m/pane/$n/pty/ctl restart a shell; also winsize C R, sig INT
+ echo exec > $m/pane/$n/pty/ctl restart a shell; also winsize C R, sig INT
Pitfalls, one each:
- Every open of new makes another pane, so `cat $m/new` twice makes two.
- ls, stat and find create nothing; reading log, event or pty/data blocks until something happens.
- exec Del closes a pane even when it is dirty; index shows the dirty flag first.
- look and exec are lowercase verbs; the words after exec are the editor's capitalized commands.
- ctl also takes acme's addr verbs (addr=dot dot=addr limit=addr clean dirty get show ...), one per line.
+ Only mkdir in pane/ makes a pane; ls, stat, find and every read create nothing.
+ Panes are named by the serial the editor gives them, not by the name mkdir asked for.
+ rmdir closes a pane even when it is dirty; index and pane/<n>/dirty show the flag.
+ addr, dot and limit read the same pair of offsets they take, so cp between them works.
+ dirty, mark and scroll read "0" or "1" and take "0" or "1"; truncating limit lifts it.
Writing body appends; open it with truncation to replace; writes are whole UTF-8 sequences.
+ Truncating tag clears the part you may edit; truncating dot or addr empties it.
A terminal's body is a history snapshot frozen per open; pty/data is the live stream.
screen is frozen per open handle as well; reopen it for a fresh frame.
- A command that fails is reported in the editor, not as a write error; a malformed line fails the write.
+ A failing command is reported in the editor, not as a write error; a bad line fails the write.
+ pane/<n>/ctl reads acme's window status line and takes one verb, get, which reloads from disk.