diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-29 01:21:21 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:15 -0300 |
| commit | 8743acbf8edd5e08e639f68022d135a244052658 (patch) | |
| tree | 29fc69ab22a6c0a65f759d9fba44546643961979 | |
| parent | 34b631e75dd646809961cae0ab215b6c43643a13 (diff) | |
| download | pardes-8743acbf8edd5e08e639f68022d135a244052658.tar.gz pardes-8743acbf8edd5e08e639f68022d135a244052658.zip | |
The tree's README fits its 45 lines again, and fs-discovery-test knows the new entries
/README had grown to 51 lines with the layout files and the round 8 notes,
past the 45 the discovery test holds it to. It is condensed (the log's
record names on one line, the column files on one, two examples fs.md
covers), and fs-discovery-test lists layout, tag and col, reads /index's
new last field, and reads /commands' setting values.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
| -rw-r--r-- | src/fs-help.txt | 16 | ||||
| -rw-r--r-- | test/fs.py | 9 |
2 files changed, 11 insertions, 14 deletions
diff --git a/src/fs-help.txt b/src/fs-help.txt index 73a49e9b..2492e933 100644 --- a/src/fs-help.txt +++ b/src/fs-help.txt @@ -5,24 +5,20 @@ 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>, newcol/delcol <column serial>, run/exit/send <serial> ..., - ask <serial> <what> <choices>, dump/restore <path>, restored/restoredcol <old> <new>, msg, err +log events: new del rename save newcol delcol run exit send ask dump restore restored restoredcol 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 ctl settings, one a line; or Newcol (an empty column), Dump, Exit (quits, asks once), Kill [w] (stops what pardes ran, w: by first word) commands every builtin: its word, arg if it takes one, and root or pane: which ctl takes it -layout one line per column: serial index x width current|notcurrent empty|full pane-serials...; then active <serial> -tag the workspace tag: read it, > replaces it, >> appends (one line) -col/<n>/tag the tag of the column with serial n, the same way (a serial stays while the column lives) -col/<n>/ctl Delcol, Joincol, New or Tty on that column; col/<n>/exec a word as a click in its tag; rmdir col/<n> closes an empty one +layout a line per column: serial index x width current|notcurrent empty|full pane-serials; active <serial> +tag the workspace tag; col/<serial>/ a column's tag, ctl (Delcol Joincol New Tty) and exec; rmdir: empty only 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 -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. +$m below: $NINE_MOUNT/pardes/<pid|NAME>; $NINE_MOUNT under 9ns --unix; PARDES_MOUNT in a Tty9p shell. cat $m/index which panes exist n=$(cat $m/pane/new) make a pane, take its serial @@ -31,9 +27,7 @@ $NINE_MOUNT itself under `9ns --unix SOCKET -- cmd`, which mounts one session as echo notes.txt > $m/pane/$n/name; echo Save > $m/pane/$n/ctl rename, then save it echo 'Msg hello' > $m/exec show text in the editor echo 'Edit ,x/foo/c/bar/' > $m/pane/$n/ctl rename every foo, one undo step (sam's commands) - cp $m/pane/$n/addr $m/pane/$n/dot; cat $m/pane/$n/sel select the range, read it exec 3<>$m/log; echo follow >&3; cat <&3 what happened lately, then wait for more - cat $m/pane/$n/event hold it open to own that pane's clicks echo Tty > $m/pane/$n/ctl; cat $m/index a terminal in that pane's directory exec 3<>$m/pane/$n/pty/run; echo make >&3; cat <&3 exit N then its output; or busy, or error printf 'ls\r' > $m/pane/$n/pty/data type into a terminal; pty/status: cols rows busy @@ -47,5 +41,5 @@ Pitfalls, one each: A terminal's body is a history snapshot frozen per open, wrapped rows joined into lines; pty/data is the live stream. exec: a non-builtin line runs as a command pane (ctl's Shell -c; exit N shown, logged), a shell's typed in. Through a mount a malformed write is EINVAL, a well-formed one that fails EIO: log's err says why. - lock/unlock need a held ctl fd (exec 3>ctl), a held lock fails: retry. A column's last pane leaves it empty; the last pane of all quits. + lock/unlock need a held ctl fd (exec 3>ctl); a held lock fails: retry. fs.md has the rest. Repl python on a terminal's ctl: a .py body's clicks go to it (Repl - unbinds, Repl says it); tags stay commands. @@ -148,7 +148,8 @@ def discovery(binary, embedded=False): top = client.list('/') # A set: which files the root holds, not the order a listing gives. assert set(top) - {'src', 'shaders'} == {'README', 'index', 'status', 'focus', 'ctl', 'commands', - 'look', 'exec', 'log', 'screen', 'listeners', 'pane', 'os'}, top + 'look', 'exec', 'log', 'screen', 'listeners', 'layout', 'tag', + 'pane', 'col', 'os'}, top assert 'self' not in top and 'cons' not in top and 'new' not in top, top assert ('src' in top) == embedded, (top, embedded) before = client.read('/index') @@ -180,7 +181,7 @@ def discovery(binary, embedded=False): assert client.read('/pane/1/dirty') == b'0\n' assert client.read('/pane/1/scroll') == b'1\n' fixture = int(before.split()[0]) - assert before.split()[1:3] == [b'text', b'0'] and before.endswith(b'/discovery.txt\n'), before + assert before.split()[1:3] == [b'text', b'0'] and before.rsplit(b' ', 1)[0].endswith(b'/discovery.txt'), before # /status reports the editor; /exec has nothing to report yet. status = dict(line.split(maxsplit=1) for line in client.read('/status').decode().splitlines()) assert int(status['pid']) > 0 and status['version'] and int(status['panes']) >= 1, status @@ -266,7 +267,9 @@ def discovery(binary, embedded=False): assert why in str(refused), refused commands = client.read('/commands').decode().splitlines() assert 'Newcol root' in commands and 'Save arg pane' in commands, commands - assert all(row.split()[-1] in ('root', 'pane') for row in commands), commands + # word, `arg` if it takes one, its ctl, then a setting's values + assert all(row.split()[2 if row.split()[1] == 'arg' else 1] in ('root', 'pane') for row in commands), commands + assert 'Placement arg root acme,pardes' in commands, commands assert client.stat('/commands')['length'] == len('\n'.join(commands)) + 1 client.write(f'/pane/{first}/ctl', b'Msg said through ctl\n') assert 'said through ctl' in ''.join(cell[0] for cell in client.screen()['cells']) |
