summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/fs-help.txt8
-rw-r--r--src/fs.zig13
2 files changed, 17 insertions, 4 deletions
diff --git a/src/fs-help.txt b/src/fs-help.txt
index 08a7e262..73a49e9b 100644
--- a/src/fs-help.txt
+++ b/src/fs-help.txt
@@ -5,7 +5,8 @@ index one line per pane: serial, kind (text|term|pdf|image), dirty flag, n
status pid, version and pane count
look write a line: a right click on it at the active pane; read: the serials it touched
exec write a line: a middle click, an editor command word or a shell line; read the same
-log events: new/del/rename/save <serial> <name>, run/exit/send <serial> ..., dump/restore <path>, msg, err
+log events: new/del/rename/save <serial> <name>, newcol/delcol <column serial>, run/exit/send <serial> ...,
+ ask <serial> <what> <choices>, dump/restore <path>, restored/restoredcol <old> <new>, msg, err
screen 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 a serial to give it the keyboard
@@ -18,9 +19,10 @@ col/<n>/ctl Delcol, Joincol, New or Tty on that column; col/<n>/exec a word as a
pane/new open it to make a pane (named +New) in the active column, filling it if empty; the read answers its serial
pane/<n>/ name body tag ctl addr dot limit data xdata sel dirty mark scroll errors (write-only:
appended to its directory's +Errors pane) event look exec, pty/ on terminals; rmdir closes
-os/, src/ the host filesystem; the editor's own sources (-Dembed-sources=true builds only)
+os/, src/ the host filesystem; the editor's own sources
-Below, $m is the mount: $NINE_MOUNT/pardes/<pid, or NAME of --detach=NAME>; PARDES_MOUNT in a Tty9p shell.
+Below, $m is the mount: $NINE_MOUNT/pardes/<pid, or NAME of --detach=NAME>; PARDES_MOUNT in a Tty9p shell;
+$NINE_MOUNT itself under `9ns --unix SOCKET -- cmd`, which mounts one session as its root.
cat $m/index which panes exist
n=$(cat $m/pane/new) make a pane, take its serial
diff --git a/src/fs.zig b/src/fs.zig
index 65e5d276..8be728a6 100644
--- a/src/fs.zig
+++ b/src/fs.zig
@@ -19,7 +19,14 @@ const Reply = tree.Reply;
const E = tree.E;
/// The served README; tree.zig answers it.
-pub const help = @embedFile("fs-help.txt");
+/// The tree's README; a build that embeds no sources lists no src/.
+pub const help = help: {
+ const raw = @embedFile("fs-help.txt");
+ if (limits.embedded_sources) break :help raw;
+ const both = "os/, src/ the host filesystem; the editor's own sources";
+ const at = std.mem.indexOf(u8, raw, both) orelse @compileError("fs-help.txt no longer lists os/, src/");
+ break :help raw[0..at] ++ "os/ the host filesystem" ++ raw[at + both.len ..];
+};
/// Host filesystem nodes: the root, and one hashed node per path a client walked to.
pub const os_root: u64 = (1 << 63) + 2;
@@ -1364,3 +1371,7 @@ pub fn unmount(p: *Pardes, name: []const u8) !void {
test {
_ = tree;
}
+
+test "the tree's README lists src/ only when the build serves it" {
+ try std.testing.expectEqual(limits.embedded_sources, std.mem.indexOf(u8, help, "src/") != null);
+}