summaryrefslogtreecommitdiff
path: root/src/macos.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-28 15:02:31 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:15 -0300
commit8d93016e923565e2e8b73aa7b549dd65b5d18a8c (patch)
tree2d0324ea3642404c421ba8b667996ded08f72ba8 /src/macos.zig
parentd70f0029f0808e0a3724150a081015e0f943dfb5 (diff)
downloadpardes-8d93016e923565e2e8b73aa7b549dd65b5d18a8c.tar.gz
pardes-8d93016e923565e2e8b73aa7b549dd65b5d18a8c.zip
Kill signals a command only while it runs, and only the pane it was meant for
A signal effect carried only a slot, so a Kill followed in the same step by the pane's closing and its slot's reuse signalled the new pane's child; and a command pane whose child had exited and been reaped kept a process group id another process could take. The effect now carries the pane's serial, checked as it is performed, and a host signals no command whose exit it has recorded; the core already sends Kill only to a command it has not been told is done. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/macos.zig')
-rw-r--r--src/macos.zig3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/macos.zig b/src/macos.zig
index 1327b064..d6ceb535 100644
--- a/src/macos.zig
+++ b/src/macos.zig
@@ -2481,7 +2481,8 @@ fn ptyResize(ctx: ?*anyopaque, pane: u8, cols: u16, rows: u16) void {
fn ptySignal(ctx: ?*anyopaque, pane: u8, sig: pardes.PtySignal) void {
const st = hostState(ctx);
- if (st.ptys[pane]) |pt| host_io.signalTty(pt.pid, pt.file.handle, sig);
+ // A command whose exit is recorded is reaped: its group may be another's.
+ if (st.ptys[pane]) |pt| if (!pt.cmd.exited) host_io.signalTty(pt.pid, pt.file.handle, sig);
}
fn ttyTaken(ctx: ?*anyopaque, pane: u8) bool {