From 990c2e1b184e9cb1fddd8eb1b05a472cfb113dde Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 28 Sep 2026 12:01:34 -0300 Subject: A closed terminal's shell is reaped on tty and macOS, killed if it ignores the hangup tty and macOS hung the pty up and called waitpid once without waiting, so a shell still exiting, or one that ignores SIGHUP, stayed a zombie or ran on with nobody reading it; tty also never reaped a shell that exited by itself, and its spawn into an occupied slot closed the old pty without ending the shell. host_io's retireShell says hangup, waits 100 ms on a thread (macOS has no host timer to poll from), then kills and reaps. The gui's own retired list, when full, left the slot holding the old shell and refused the next spawn into that pane; it now hands that shell to retireShell instead. Co-Authored-By: Claude Opus 5.5 --- src/gui/gui.zig | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/gui/gui.zig') diff --git a/src/gui/gui.zig b/src/gui/gui.zig index 1d5d3c05..2369dd28 100644 --- a/src/gui/gui.zig +++ b/src/gui/gui.zig @@ -3786,6 +3786,10 @@ const Shell = struct { s.ptys[pane] = null; return; }; + // No room to wait for it here: a slot kept for it would refuse the + // next shell spawned into this pane until it was reaped. + host_io.retireShell(pt.pid); + s.ptys[pane] = null; } fn stopPtys(s: *Shell) void { -- cgit v1.3