summaryrefslogtreecommitdiff
path: root/src/fs-help.txt
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs-help.txt')
-rw-r--r--src/fs-help.txt71
1 files changed, 35 insertions, 36 deletions
diff --git a/src/fs-help.txt b/src/fs-help.txt
index a0a84b28..40dd05c5 100644
--- a/src/fs-help.txt
+++ b/src/fs-help.txt
@@ -1,42 +1,41 @@
-Pardes control filesystem
+Pardes virtual 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
-log one line per editor event (new/del/rename/save <serial> <name>); reads wait
-screen rendered screen as JSON, frozen from open to close
+README this summary; the pardes book's Scripting and Reference chapters have the rest
+index a line per pane: serial kind(text|term|cmd|pdf|image) dirty name column; names hold blanks: rsplit(maxsplit=1)
+status pid, version and pane count
+look write a line: a right click on it at the pane with the keyboard; read: the serials it touched (this open's)
+exec write a line: a middle click, a builtin or a shell line; read the same (every exec file)
+pager write a directory: its one +Pager, made or emptied; read the same open: its serial (pardes -)
+log events: new del rename save newcol delcol run exit send ask answer changed dump restore restored restoredcol msg err
+screen the 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
-os/ the host filesystem
-src/ the editor's own sources, only in a -Dembed-sources=true build
+focus the serial of the pane with the keyboard (empty on a column tag); write one to give it the keyboard
+ctl settings a line; or Newcol, Dump, Restore [f], Exit (refuses once over unsaved panes), Kill [w], size C R
+commands every builtin: word, arg, root|pane|both (the ctl that takes it), -- what it does
+recent files opened lately, closed ones too: open|closed <path>
+layout a line per column: serial index x width current|notcurrent empty|full pane-serials; then active <serial>
+tag the workspace tag, tagexec a word as a click in it; col/<serial>/ a column's tag, ctl, exec; rmdir: empty only
+pane/new open it to make a pane (<session dir>/+New) in the active column; the read answers its serial
+pane/<n>/ name body tag ctl addr dot limit data xdata sel dirty mark scroll errors event look exec tagexec; rmdir closes
+ on terminals pty/data (keys in, output out), pty/status, pty/ctl (winsize, sig, exec), pty/run (a line, its exit and output)
+os/, src/ the host filesystem; the editor's own sources
-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):
+$m below: $PARDES_MOUNT (set under 9ns --mntgen and in a Tty9p shell); without it, 9p -a "unix!$PARDES_9P".
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)
- 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 '#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
- 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
+ n=$(cat $m/pane/new) make a pane of your own (each open makes one), take its serial
+ exec 3<>$m/pane/$n/look; echo /etc/hosts:3 >&3; cat <&3 open a file through it, see the pane it went to
+ printf 'text\n' >> $m/pane/$n/body append to it (> replaces it all)
+ echo 'Msg hello' > $m/pane/$n/exec show text in the editor
+ echo 'Edit ,x/foo/c/bar/' > $m/pane/$n/ctl sam's Edit, one undo step; an x that matches nothing succeeds
+ echo /re/ > $m/pane/$n/addr; printf new > $m/pane/$n/data replace the next match
+ exec 3<>$m/log; echo follow >&3; cat <&3 what happened lately, then wait for more
+ exec 3<>$m/pane/$n/pty/run; echo make >&3; cat <&3 exit N, then the output
-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.
- Writing body appends; open it with truncation to replace; writes are whole UTF-8 sequences.
- 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.
+Traps:
+ A refused write says only EINVAL or EIO; grep '^err' log | tail -1 says why (not the last line, maybe +Unsaved's new).
+ Root look and exec act at the pane with the keyboard, which another client may own: use a pane's own look and exec.
+ addr is the pane's and moves on: each /re/ searches from the last, a data write leaves it past the text.
+ Through a mount, printf 'a\nb\n' arrives a line a write: send a block with one write, ending in a newline.
+ Pane words (Save Undo Del) go to pane/<n>/ctl, settings and session words to /ctl.
+ Exit, Restore, Del and get refuse once over unsaved text; the same word again discards.