diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-27 18:07:06 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:14 -0300 |
| commit | 6f7beca8d27e2e00f7b90bb75015637a9aa4c950 (patch) | |
| tree | 823e143a5e29aca8049c905213e40520f3354383 /src/fs-help.txt | |
| parent | f4412d6dfdb1e2bd8549a7edba785ee242fd38f2 (diff) | |
| download | pardes-6f7beca8d27e2e00f7b90bb75015637a9aa4c950.tar.gz pardes-6f7beca8d27e2e00f7b90bb75015637a9aa4c950.zip | |
Run a line at a terminal's prompt through pty/run and read how it ended
/pane/<n>/pty/run takes factotum's rpc shape: write one line on an open,
read the answer on that same open. The answer is exit N once the command
ended and the shell is back at a prompt; busy at once when a command runs,
text is typed at the prompt, or the shell has not drawn its first prompt;
error not run when the shell refused the line without running it (fish on
a syntax error keeps it on the prompt, so it is taken back with Ctrl-U);
error shell gone when the pane closes or its shell is replaced; error no
prompt marks for a shell pardes could not instrument.
The end comes from the shell's OSC 133 marks. ghostty parses D's exit
status and drops it, so the stream now runs through a handler that wraps
ghostty's and follows prompt -> input -> running -> done. The marks pardes
injects into bash and fish carry aid=pardes and only those count, so fish
4's own marks (which doubled ours), a nested shell's, and a stray 133;D in
printed output are ignored.
Checked end to end against real bash and fish: false, exit 7, a syntax
error, sleep, busy while running, and the pane closing mid-command.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/fs-help.txt')
| -rw-r--r-- | src/fs-help.txt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fs-help.txt b/src/fs-help.txt index db046946..cc682cf7 100644 --- a/src/fs-help.txt +++ b/src/fs-help.txt @@ -30,11 +30,11 @@ Below, $m is the mount point (PARDES_MOUNT in a Tty9p shell; 9ns and 9p work too 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 exec > $m/pane/$n/pty/ctl restart a shell; also winsize C R, sig INT + exec 3<>$m/pane/$n/pty/run; echo make >&3; cat <&3 exit N, busy or error, once back at a prompt printf 'ls\r' > $m/pane/$n/pty/data type into a terminal; pty/status: cols rows busy Pitfalls, one each: - Each open of pane/new makes another pane; two reads of one fid name the same one. - Only that open creates: ls, stat, find and every other read leave the tree alone. + Each open of pane/new makes another pane (ls, stat, find never do); a reread names the same. rmdir closes a pane even when it is dirty; index and pane/<n>/dirty show the flag. addr, dot and limit read the same pair of offsets they take, so cp between them works. dirty, mark and scroll read "0" or "1" and take "0" or "1"; truncating limit lifts it. |
