From 74286e81e88a6df7586ead9e8bcd503d44446a85 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 29 Oct 2026 17:58:06 -0300 Subject: docs: views in the guide and reference (a session attached already takes another view, up to four; Detach lets one go); phase 4 notes in docs/next-daemon.md; tty: Screen.hungUp reads a test terminal's fd as the test build has it Co-Authored-By: Claude Opus 5.5 --- src/tty/tty.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/tty/tty.zig') diff --git a/src/tty/tty.zig b/src/tty/tty.zig index f949d571..b56e74b1 100644 --- a/src/tty/tty.zig +++ b/src/tty/tty.zig @@ -1329,8 +1329,9 @@ const Screen = struct { /// Its terminal hung up, or the stub that waits on it is gone. fn hungUp(sc: *const Screen) bool { const stub = if (sc.primary) daemon.stub else sc.stub; + const handle = if (@TypeOf(sc.tty.fd) == std.Io.File) sc.tty.fd.handle else sc.tty.fd; var fds = [_]posix.pollfd{ - .{ .fd = sc.tty.fd.handle, .events = 0, .revents = 0 }, + .{ .fd = handle, .events = 0, .revents = 0 }, .{ .fd = stub, .events = 0, .revents = 0 }, }; _ = posix.poll(fds[0..if (stub >= 0) 2 else 1], 0) catch return false; -- cgit v1.3