From 8b18331f5e3f6c346b992019163ec3f5b6e6b721 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 28 Sep 2026 12:06:13 -0300 Subject: Kill asks the host to signal at once and says when a shell has no job to signal Kill queued a signal effect for later, so the job it saw running by its marks could have ended, and another started, before the signal went; and with job control off the job shares the shell's process group, so the host skipped it and Kill reported nothing. Kill now calls the host's kill_job while it holds the turn, and when the only job is the shell's own group says 'Kill: no job to signal', which also fails a write of Kill to ctl. Co-Authored-By: Claude Opus 5.5 --- src/detached/server.zig | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/detached/server.zig') diff --git a/src/detached/server.zig b/src/detached/server.zig index 0cf1729f..5c0e1487 100644 --- a/src/detached/server.zig +++ b/src/detached/server.zig @@ -353,6 +353,7 @@ pub const Session = struct { .pty_signal = ptySignal, .close_pty = closePaneShell, .tty_taken = ttyTaken, + .kill_job = killJob, .write_file = writeFile, .write_dump = writeDump, .watch_file = watchFile, @@ -521,6 +522,14 @@ pub const Session = struct { return host_io.ttyTaken(pt.pid, pt.fd); } + fn killJob(ctx: ?*anyopaque, pane: u8) bool { + const s = of(ctx); + if (pane >= s.ptys.len) return false; + const pt = s.ptys[pane]; + if (pt.fd < 0) return false; + return host_io.killJob(pt.pid, pt.fd); + } + fn writeFile(ctx: ?*anyopaque, pane: u8, path: []const u8, bytes: []const u8) void { const s = of(ctx); filesystem.write(s.core, path, bytes) catch |err| -- cgit v1.3