summaryrefslogtreecommitdiff
path: root/src/pardes.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-28 12:06:13 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:14 -0300
commit8b18331f5e3f6c346b992019163ec3f5b6e6b721 (patch)
treef6e0236af8b0ac0428078d5ba512df10a1f3f43d /src/pardes.zig
parent990c2e1b184e9cb1fddd8eb1b05a472cfb113dde (diff)
downloadpardes-8b18331f5e3f6c346b992019163ec3f5b6e6b721.tar.gz
pardes-8b18331f5e3f6c346b992019163ec3f5b6e6b721.zip
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 <[email protected]>
Diffstat (limited to 'src/pardes.zig')
-rw-r--r--src/pardes.zig8
1 files changed, 7 insertions, 1 deletions
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