summaryrefslogtreecommitdiff
path: root/docs/typ/reference.typ
diff options
context:
space:
mode:
Diffstat (limited to 'docs/typ/reference.typ')
-rw-r--r--docs/typ/reference.typ28
1 files changed, 20 insertions, 8 deletions
diff --git a/docs/typ/reference.typ b/docs/typ/reference.typ
index 30ca9646..bb13b011 100644
--- a/docs/typ/reference.typ
+++ b/docs/typ/reference.typ
@@ -586,7 +586,8 @@ while a column or workspace tag has the keyboard.
length, isdir (1 for a directory pane, else 0), dirty, width in cells, font, tab width, undo available,
redo available, then `current`/`notcurrent`, a REPL's id if bound,
`collapsed` when it is, and for a PDF `fit:width|height
-tint:disabled|filtered|full`. It
+tint:disabled|filtered|full`. Each field ends in a blank and the line has
+no newline, as acme's has none (`cat ctl; echo`). It
takes:
- the pane builtins: #word("Del") (from the keyboard between two panes it
@@ -729,13 +730,23 @@ Each command runs in its file's directory through #word("Shell"), off the
loop, so the editor goes on, with what a pane's command is given:
`$PARDES_MOUNT`, `$PARDES_9P`, `$PARDES_PID`, and `$winid` the Edit's pane. The write that ran the Edit is held and
answered when they are done, its connection serving other requests
-meanwhile (a command may read the session through its mount; one that writes the #file("ctl") its Edit came by must not truncate it, `1<>ctl` rather than `>ctl`, as Linux holds the inode lock through an O_TRUNC open and the write waits out the 10-second limit); a flush of
-that write (an interrupted writer) kills the commands and changes nothing.
+meanwhile (a command may read the session through its mount). A command
+that writes the #file("ctl") its Edit came by needs `<>` on both sides, the
+Edit's write (`exec 3<>$p/ctl; echo 'Edit ...' >&3`) and its own (`1<>`):
+with `>` or `>>` on either, the kernel holds the second write until the
+first is answered, the command is stopped at its 10-second limit, and the
+Edit fails (EIO), changing nothing. For the same reason a second Edit written
+with `>` to that #file("ctl") waits for the first to finish rather than being
+refused; through its own `<>` open, or another pane's #file("ctl"), it is
+refused `busy` (EBUSY) at once. A flush of the Edit's write (an interrupted
+writer) kills the commands and changes nothing.
Such an Edit is a write of its own: one with other lines is refused before
any runs. One Edit's commands run at a time in a session, at most 1024 of
them. While they run, an Edit with no commands runs as usual unless it
would change, undo, rename, close or write a file the running one changes;
-that, and a second Edit with commands, is refused `busy` (EBUSY). A command that fails (an exit status, 10 seconds, 1 MiB of output)
+that, and a second Edit with commands, is refused `busy` (EBUSY), as are
+#word("Del") (acme's `delete`), `rmdir`, #word("Undo"), #word("Redo"), #word("Get") and #word("Zerox") on a pane
+it changes or runs a command on; a session that ends lets the commands go. A command that fails (an exit status, 10 seconds, 1 MiB of output)
fails the Edit, its stderr in `+Errors`. Each file's changes are one undo step, applied only if
every command succeeds; a failure changes nothing and fails the write with
acme's words (`Edit: no substitution`), as does a file edited while the
@@ -926,7 +937,7 @@ a FILE not there yet opens an empty pane that #word("Save") creates, making
its directories. What the session refuses (a bad name; a name under a
directory you may not search or write, `permission denied`) is printed and
the exit is 1. `--` ends the options (`pardes -- -name`).
-`pardes --wait FILE` (`-w`) returns 0 when the pane showing FILE is
+`pardes --wait FILE` (`-w`; bare, it says it needs a FILE) returns 0 when the pane showing FILE is
deleted, 1 when the session goes away (against a dead `$PARDES_9P` it
says the session is gone); with
`PARDES_9P` set but no pane of its own it opens FILE in that session and
@@ -988,7 +999,7 @@ it was.
`--no-prefix` diff's paths are kept.
- *Sessions.* Bare `--detach` names the session after its pid; bare
`--attach` needs exactly one session; a second `--detach=NAME` while NAME
- runs says so and exits 1. Frontends share the smallest common size. With
+ runs (a plain session is named by its pid) says so in words and exits 1. Frontends share the smallest common size. With
none attached, `size C R` sets the screen, messages clear by the clock,
and a pty reports its size in pixels at the last frontend's cell size
(8×16 before any), as CSI 14, 16 and 18 t do.
@@ -998,7 +1009,8 @@ it was.
notice and `err - init file line N: why`, and the rest still run; a
setting only the other frontend has (#word("Font") in a terminal) is skipped;
text that is no builtin is not run; saving the init file in a pane
- applies its settings again. A dump keeps panes, columns, tags,
+ applies its settings again and says a bad line as startup does
+ (`err - init file line N: why`), its commands not run again. A dump keeps panes, columns, tags,
selections, the theme and changed settings, but not a picture or a PDF
that is on disk (#word("Restore") reads it from there); a terminal
comes back with its last MiB of output and a new shell in its old
@@ -1083,7 +1095,7 @@ with Client(sys.argv[1]) as c: # a socket path, or (ip, port)
[`addr` reset on first open], [#file("addr") is the pane's; no open resets it (write `0`)],
[OTRUNC on `data` ignored], [`: > data` deletes the addressed text; OTRUNC on #file("body") (`9p write`) replaces it all],
[event flags 1, 2, 4, 8], [1, 4 and 8; never 2, so no expansion record follows],
- [`Get`], [#word("Get") reads the file again, refusing unsaved edits once (a scratch under 100 bytes unasked, as #word("Del") closes it); `Get file` loads that file into the pane, which takes its name, and one that fails changes nothing; #word("Undo") after it, or after #word("Edit")'s `e`, puts the old name back with the old text and its saved state; in a directory pane #word("Get") reads the directory again and `Get file` is refused (#word("Look") opens the file) (also `get` on #file("ctl"))],
+ [`Get`], [#word("Get") reads the file again, refusing unsaved edits once (a scratch under 100 bytes unasked, as #word("Del") closes it; a file not there, or a directory, is said first); `Get file` loads that file into the pane, which takes its name, and one that fails changes nothing; #word("Undo") after it, or after #word("Edit")'s `e`, puts the old name back with the old text and its saved state; in a directory pane #word("Get") reads the directory again and `Get file` is refused (#word("Look") opens the file) (also `get` on #file("ctl"))],
[`Put`, `Delete`, `Load`], [#word("Save"); a #word("Del") that does not ask; #word("Restore")],
[`Putall`], [#word("Putall"): every pane with unsaved edits to a file is saved, a #word("Zerox") pair once, a refused one said; with a refusal, its write is answered once the other saves have landed],
[`Zerox`], [#word("Zerox"): a second pane on the buffer, one text, undo and unsaved state, its own scroll and cursor; an event reader on one hears no edit made through the other; the twins are kept across #word("Dump") and #word("Restore")],