summaryrefslogtreecommitdiff
path: root/src/fs-help.txt
blob: a0a84b28c80c867ef462d52664888735fb423743 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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
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
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)
  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

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.