summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tty/tty.zig3
1 files changed, 2 insertions, 1 deletions
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;