From 98e94b86a7c38e2bf4d66e57144fc9329906bb3b Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 03:37:13 -0300 Subject: Tty and Shell refuse a directory: not a shell A directory passes access(X_OK), so Tty /etc made a pane whose shell exited 127 and Shell /etc was taken. The shell lookup now refuses a directory, and both say "not a shell: /etc is a directory" (Tty and Shell share one refusal, host_io.Shell.refusal). shellset's golden takes the shared wording (re-recorded by name). Co-Authored-By: Claude Opus 5.5 --- src/pardes.zig | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/pardes.zig') diff --git a/src/pardes.zig b/src/pardes.zig index 9297c829..72fd4d46 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -1807,6 +1807,10 @@ test "Tty+fish, one word a tag can hold, opens a terminal on that shell" { try std.testing.expect(std.mem.indexOf(u8, caller.msg[0..caller.msg_len], "no shell \"/nonexistent\"") != null); try std.testing.expect(p.executeBuiltinLine(0, "Tty fsh-not-a-shell")); try std.testing.expect(caller.shell == null); + // A directory passes access(X_OK); it is no shell either. + try std.testing.expect(p.executeBuiltinLine(0, "Tty /etc")); + try std.testing.expect(p.active == before); + try std.testing.expect(std.mem.indexOf(u8, caller.msg[0..caller.msg_len], "Tty: not a shell: /etc is a directory") != null); // Only a word that says so splits at `+`: `Dump+x.zon` is no Dump. try std.testing.expect(!p.executeBuiltinLine(0, "Dump+x.zon")); try std.testing.expect(!p.executeBuiltinLine(0, "Msg+hello")); -- cgit v1.3