summaryrefslogtreecommitdiff
path: root/src/pardes.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 09:51:11 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:16 -0300
commitad3403adb72e3457eb76d6b3fc91cf8df3d738ae (patch)
tree1669efb3e6891b3a32a71c1fcffe8dd48428d9b2 /src/pardes.zig
parent6e2ed2e057ba95b3a86186c255d1965e1861bdf7 (diff)
downloadpardes-ad3403adb72e3457eb76d6b3fc91cf8df3d738ae.tar.gz
pardes-ad3403adb72e3457eb76d6b3fc91cf8df3d738ae.zip
A shell that cannot start fails Tty and pty/ctl exec with why, before either answers
A shell whose exec failed (a script's missing interpreter) was reported started: Tty and pty/ctl exec succeeded, then the pane died. The child now reports a failed chdir or exec through a close-on-exec pipe the parent reads before acknowledging the shell; the host's spawn fails with the reason (`shell not found`, ENOENT), which fails the waiting write. A Tty whose first shell never ran leaves no pane; a terminal restarted by pty/ctl exec keeps its pane. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/pardes.zig')
-rw-r--r--src/pardes.zig6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/pardes.zig b/src/pardes.zig
index 26c9246a..35b44871 100644
--- a/src/pardes.zig
+++ b/src/pardes.zig
@@ -5023,6 +5023,7 @@ pub const Pardes = struct {
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.had_shell = true;
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.
@@ -5266,6 +5267,11 @@ pub const Pardes = struct {
if (pane.command != null and !pane.command_done) {
pane.command_pty = false;
exec.commandDone(p, id, 127);
+ } else if (pane.command == null and !pane.had_shell) {
+ // A Tty whose shell never ran: no dead pane left behind; the
+ // write that asked for it has failed with why. A terminal whose
+ // shell was started again (pty/ctl exec) keeps its pane.
+ p.unplaced.set(id);
}
}