summaryrefslogtreecommitdiff
path: root/src/detached/server.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/detached/server.zig')
-rw-r--r--src/detached/server.zig21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/detached/server.zig b/src/detached/server.zig
index 9a8dc24f..d8373149 100644
--- a/src/detached/server.zig
+++ b/src/detached/server.zig
@@ -590,14 +590,14 @@ pub const Session = struct {
return @ptrCast(@alignCast(ctx.?));
}
- /// Seventeen methods, and NOT the fullest host in the tree — that claim
+ /// Eighteen methods, and NOT the fullest host in the tree — that claim
/// stood here, was believed, and was copied into docs/detached.md before an
- /// audit counted the others. The tty and SDL shells fill NINETEEN each
- /// (everything but `pull_gpio_toggle` and `push_detach`) and macOS fourteen,
+ /// audit counted the others. The tty and SDL shells fill TWENTY each
+ /// (everything but `pull_gpio_toggle` and `push_detach`) and macOS fifteen,
/// so this host is the only one that implements `push_detach` and otherwise
/// the least complete of the three desktop hosts. What is true is narrower
/// and is the point anyway: it performs every MACHINE-LOCAL effect there is,
- /// and the four of host.zig's twenty-one it leaves null are null because
+ /// and the four of host.zig's twenty-two it leaves null are null because
/// there is nothing here for them to do. Two of those four are real losses a
/// person can notice — no `pull_lsp` and no `pull_pipe`, because both want
/// the worker pool this deliberately single-threaded loop does not have. The
@@ -619,6 +619,7 @@ pub const Session = struct {
.push_spawn = spawn,
.push_pty_write = ptyWrite,
.push_pty_resize = ptyResize,
+ .push_pty_signal = ptySignal,
.pull_tty_taken = ttyTaken,
.push_write_file = writeFile,
.push_write_dump = writeDump,
@@ -771,6 +772,18 @@ pub const Session = struct {
_ = posix.system.ioctl(fd, TIOCSWINSZ, @intFromPtr(&ws));
}
+ /// `pty/ctl`'s `sig` — and the host where it matters most, because these
+ /// shells outlive every frontend: a script that signals a build in a
+ /// detached session is signalling a process nobody has a terminal on.
+ /// `fd < 0` is a pane with no shell, the same silence `ptyWrite` gives it.
+ fn ptySignal(ctx: ?*anyopaque, pane: u8, sig: pardes.PtySignal) void {
+ const s = of(ctx);
+ if (pane >= s.ptys.len) return;
+ const pt = s.ptys[pane];
+ if (pt.fd < 0) return;
+ look.signalTty(pt.pid, pt.fd, sig);
+ }
+
/// Is this pane's tty still the prompt we forked, or has a program taken it?
///
/// Answerable at all only because the pty is HERE. While a pane's shell