summaryrefslogtreecommitdiff
path: root/src/fs-help.txt
blob: eeb000cc0d7c0501a0f4f077d0ec945d01a517f3 (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
Pardes control filesystem
=========================
The mount root contains self/ (this editor) and os/ (host files).
This guide is available as self/README and self/new/README.
Examples below run inside a Tty9p shell, where PARDES_MOUNT is set.

Explore
-------
  ls "$PARDES_MOUNT/self"
  cat "$PARDES_MOUNT/self/index"
  ls -l "$PARDES_MOUNT/self/new"
  ls "$PARDES_MOUNT/self/pane"

index lists panes: serial, tag length, body length, reserved zero,
modified flag, then tag text. Use the serial in self/pane/<serial>/.
screen is rendered screen JSON; listeners lists the session addresses.
cons accepts text to display in the editor.

Create a pane
-------------
new/ lists the same files as a scratch pane, plus this README.
Listing, walking and statting these paths do not create anything.
OPENING any file except README creates one scratch pane below the active pane.
Each open creates a separate pane, even if you open the same path again.

  cat "$PARDES_MOUNT/self/new/ctl"

This creates a pane and prints its control information, beginning with its
serial. Use self/pane/<serial>/ for all subsequent operations on that pane.
To create a pane and write its initial text in one operation:

  printf 'Hello from the shell\n' > "$PARDES_MOUNT/self/new/body"

Reading all files recursively would open factories and create panes.
Use ls or stat to inspect them; read README for this guide.

Work with an existing pane
--------------------------
Replace <serial> with a number from index or new/ctl:

  cat "$PARDES_MOUNT/self/pane/<serial>/body"
  printf 'Replacement text\n' > "$PARDES_MOUNT/self/pane/<serial>/body"
  printf 'More text\n' >> "$PARDES_MOUNT/self/pane/<serial>/body"
  printf 'name notes.txt\n' > "$PARDES_MOUNT/self/pane/<serial>/ctl"

body       buffer text; for terminals, reads history and writes child input
 tag       editable pane tag
 ctl       control information on read; newline-separated commands on write
 addr      address range; write #0,#5 to select the first five bytes
 data      read from addr onward, or replace the range selected by addr
 xdata     read only the range selected by addr; writes replace that range
 rdsel     read the editor selection
 wrsel     replace the editor selection
 errors    write diagnostics
 event     pane interaction events; opening intercepts Look/Exec events

Common ctl commands: name PATH, put (save), get (reload), dot=addr,
addr=dot, look PATH, del (close, refusing dirty text), delete (force close).
Reload and force close can discard unsaved changes.

Terminal panes also expose pty/ctl, pty/status and pty/data.
Writing pty/data sends terminal input; use carriage return to submit a command.
Reading pty/data streams new output; read body for a history snapshot.

Embedded source files under self/src/ document the complete interface.