diff options
Diffstat (limited to 'src/macos.zig')
| -rw-r--r-- | src/macos.zig | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/macos.zig b/src/macos.zig index 2b04237e..9bbe3ac2 100644 --- a/src/macos.zig +++ b/src/macos.zig @@ -1764,6 +1764,7 @@ const vtable: pardes.Host.VTable = .{ .push_spawn = spawnShell, .push_pty_write = ptyWrite, .push_pty_resize = ptyResize, + .push_pty_signal = ptySignal, .pull_tty_taken = ttyTaken, .push_write_file = writeFile, .push_write_dump = writeDump, @@ -1830,6 +1831,14 @@ fn ptyResize(ctx: ?*anyopaque, pane: u8, cols: u16, rows: u16) void { _ = posix.system.ioctl(pt.file.handle, TIOCSWINSZ, @intFromPtr(&ws)); } +/// `pty/ctl`'s `sig`. Unlike `ttyTaken` above this is NOT degraded on darwin: +/// `tcgetpgrp` on the master and `kill` are both POSIX, and neither needs the +/// libproc descendant walk `look.ttyTaken` is still waiting for. +fn ptySignal(ctx: ?*anyopaque, pane: u8, sig: pardes.PtySignal) void { + const st = hostState(ctx); + if (st.ptys[pane]) |pt| look.signalTty(pt.pid, pt.file.handle, sig); +} + /// Asked only where a command line is about to be typed: is a program holding /// this pane's tty instead of the prompt we forked? `look.ttyTaken` answers /// `false` on darwin until it grows a libproc implementation, so this host |
