From 4d4818f7baf356866d323e4b337a64a3dddd8adb Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 09:09:47 -0300 Subject: pty/ctl exec fails the write when the shell cannot start; a directory removed under a shell leaves its name `exec` on pty/ctl restarted a shell in a directory that was gone, the write succeeding and the pane dead; and the pane was then renamed ` (deleted)` from /proc, so a restart failed even once the directory was back. `exec` is now refused up front, ENOENT, where the directory is gone; a shell the host cannot start fails the waiting write (late failure, as a Save's); and a `(deleted)` cwd is no name to take. Co-Authored-By: Claude Opus 5.5 --- docs/fs.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/fs.md b/docs/fs.md index d94a1954..0b255390 100644 --- a/docs/fs.md +++ b/docs/fs.md @@ -908,7 +908,13 @@ where the host cannot name the program, and when text is typed at the prompt) terminal (a REPL, `less`) takes none: write to `pty/data` for it -- which is also when the third field of `pty/status` reads 1. `pty/status` is one line, three right-aligned fields and a newline: the pty's columns and -rows, then busy (0 or 1). The size, and `pty/ctl`'s `winsize` read back, is +rows, then busy (0 or 1). `pty/ctl` takes `winsize C R`, `sig +INT|TERM|HUP|QUIT|KILL` and `exec`, which starts the pane's shell again in +its directory: one that is gone is refused before anything runs, `exec: +: no such directory` (ENOENT), and a shell the host cannot start fails +the write with why, as any builtin's failure does. A directory removed +under a running shell leaves the pane its name (never `... (deleted)`), so +an `exec` works there once the directory is back. The size, and `pty/ctl`'s `winsize` read back, is what `winsize C R` last set (R of 1 is taken as 2: a one-row pty loses its prompt's mark and would read busy for ever), until the pane itself resizes and gives the pty its grid again. A line written -- cgit v1.3