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/pardes.zig | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/pardes.zig') diff --git a/src/pardes.zig b/src/pardes.zig index 59556649..6e78380a 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -3111,7 +3111,7 @@ pub const PendingWrite = struct { bytes: []u8, off: usize = 0 }; /// `command` is Kill's: SIGTERM to the terminal's foreground job, and never /// to the shell itself when the shell is in the foreground. -pub const PtySignal = enum(u8) { int, term, hup, quit, kill, command }; +pub const PtySignal = enum(u8) { int, term, hup, quit, kill }; /// IO the core wants done. Payloads are inline (fixed buffers): effects are /// queued values with no lifetime ties back into the core. @@ -3928,6 +3928,7 @@ pub const Pardes = struct { pub const setStatus = Messages.setStatus; pub const setMessage = Messages.setMessage; pub const reportError = Messages.reportError; + pub const reportFailure = Messages.reportFailure; /// Running a builtin line, called from everywhere as /// `p.executeBuiltinLine(...)`; it lives with the rest of exec in exec.zig. @@ -4510,6 +4511,11 @@ pub const Pardes = struct { return f(p.host.ctx, @intCast(id)); } + pub fn hostKillJob(p: *const Pardes, id: usize) bool { + const f = p.host.vtable.kill_job orelse return false; + return f(p.host.ctx, @intCast(id)); + } + fn hostWriteFile(p: *Pardes, pane: u8, path: []const u8, bytes: []const u8) void { if (p.host.vtable.write_file) |f| return f(p.host.ctx, pane, path, bytes); // The in-process filesystem reports the same way a real host does, so -- cgit v1.3