summaryrefslogtreecommitdiff
path: root/src/fs-help.txt
blob: 1ffccc00813824e90916af6789e3178c8d021325 (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
Pardes control filesystem
=========================
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
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

$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/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

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.