diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-29 08:02:47 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:16 -0300 |
| commit | 0ec8d0dc6217486446f2fe2156dff136173a4ef5 (patch) | |
| tree | 8e20f9f0fec47f614492d31c7f03a03e3ac1d0c5 /src/pardes.zig | |
| parent | ba0a0f82be43dde325012b3018b186bc808bdafc (diff) | |
| download | pardes-0ec8d0dc6217486446f2fe2156dff136173a4ef5.tar.gz pardes-0ec8d0dc6217486446f2fe2156dff136173a4ef5.zip | |
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: <dir>: 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 <[email protected]>
Diffstat (limited to 'src/pardes.zig')
| -rw-r--r-- | src/pardes.zig | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/pardes.zig b/src/pardes.zig index 002ff6f9..3a574dc9 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -5010,6 +5010,7 @@ pub const Pardes = struct { pub fn acknowledgeShell(p: *Pardes, id: usize, executable: []const u8, prompt_marks: bool) void { if (id < MAX_PANES) if (p.panes[id]) |pane| { ctlfs.pty.shellGone(p, pane, true); // a respawn replaced whatever ran + pane.shell_failed = false; pane.fs.unmarked = !prompt_marks; // The tag's Tty word names the shell the host ran, and a click // on it (`Tty+fish`) opens another of the same. @@ -5230,6 +5231,16 @@ pub const Pardes = struct { p.emit(.{ .watch = .{ .pane = id, .on = true } }); } + /// A terminal whose shell could not be started: said, and a run waiting + /// on it, or written to it from now on, hears `error shell gone` + /// rather than wait for a prompt that never comes. + pub fn shellFailed(p: *Pardes, id: u8, err: anyerror) void { + const pane = p.panes[id] orelse return; + pane.shell_failed = true; + ctlfs.pty.shellGone(p, pane, false); + p.reportError(id, "shell", err); + } + pub fn saveFailed(p: *Pardes, id: u8, path: []const u8, err: anyerror) void { if (p.panes[id]) |pane| if (pane.file) |*f| { // The `-%` spelling fs.zig already uses for "make this dirty". |
