From 0ec8d0dc6217486446f2fe2156dff136173a4ef5 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 08:02:47 -0300 Subject: Tty in a missing directory fails and makes no pane; a shell that never started answers runs The host could not start the shell (its chdir failed), and the pane stayed with no pty: a run written to it waited for a prompt for ever. Tty now refuses a directory that is not there, `Tty: : no such directory`, before making a pane; and a terminal whose shell the host could not start (Pardes.shellFailed, from each host's spawn) answers any run with `error shell gone`. Co-Authored-By: Claude Opus 5.5 --- src/ninep/pty.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/ninep/pty.zig') diff --git a/src/ninep/pty.zig b/src/ninep/pty.zig index 4009af49..68f98554 100644 --- a/src/ninep/pty.zig +++ b/src/ninep/pty.zig @@ -196,7 +196,10 @@ pub fn writeRun(p: *Pardes, req: Req, id: usize, pane: *Pane) Reply { const pf = &pane.fs; const state = pane.terminal orelse return tree.failText(req.tag, E.INVAL, e_bad_line); const marks = &state.stream.handler; - if (pane.command != null) { + if (pane.shell_failed) { + // Its shell never started: no prompt is coming to wait for. + answer(p, slot, "error shell gone", .{}); + } else if (pane.command != null) { // Its child is the command, and no shell is there to take a line. answer(p, slot, "error {s}", .{if (pane.command_done) "command done; not a shell" else "a command runs here, not a shell"}); } else if (pf.unmarked) { -- cgit v1.3