summaryrefslogtreecommitdiff
path: root/src/host_io.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/host_io.zig')
-rw-r--r--src/host_io.zig8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/host_io.zig b/src/host_io.zig
index ac25e63c..8cbdd2d4 100644
--- a/src/host_io.zig
+++ b/src/host_io.zig
@@ -19,6 +19,10 @@ pub const Host = struct {
present: ?*const fn (ctx: ?*anyopaque, surface: *const pardes.Surface) void = null,
post_present: ?*const fn (ctx: ?*anyopaque) void = null,
poll_frame: ?*const fn (ctx: ?*anyopaque) void = null,
+ /// Whether anyone sees a frame drawn now. A detached session with no
+ /// client attached draws none (a /screen read draws its own), and
+ /// the frame owed is drawn when one attaches. Absent: always.
+ watched: ?*const fn (ctx: ?*anyopaque) bool = null,
detach: ?*const fn (ctx: ?*anyopaque) void = null,
spawn: ?*const fn (ctx: ?*anyopaque, pane: u8, cwd: []const u8) void = null,
pty_write: ?*const fn (ctx: ?*anyopaque, pane: u8, bytes: []const u8) void = null,
@@ -1601,6 +1605,10 @@ pub fn ttyTaken(shell_pid: libc.pid_t, master_fd: c_int) bool {
const exe = procExe(node.pid, &probe.exe) orelse {
if (offTty(node.pid, &probe.blob)) continue;
+ // Exiting (its exe gone, not a zombie yet), or not ours
+ // to read: outside the foreground group it holds
+ // nothing, as a killed background job does for a moment.
+ if (pgrp) |g| if (g != fg) continue;
return true;
};
if (!std.mem.eql(u8, exe, self_exe)) {