mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 16:56:09 +03:00
termio/exec: if read thread gets 0 bytes then break the tight loop
This commit is contained in:
@ -964,7 +964,10 @@ const ReadThread = struct {
|
|||||||
log.warn("read thread failed to set flags err={}", .{err});
|
log.warn("read thread failed to set flags err={}", .{err});
|
||||||
log.warn("this isn't a fatal error, but may cause performance issues", .{});
|
log.warn("this isn't a fatal error, but may cause performance issues", .{});
|
||||||
};
|
};
|
||||||
} else |_| {}
|
} else |err| {
|
||||||
|
log.warn("read thread failed to get flags err={}", .{err});
|
||||||
|
log.warn("this isn't a fatal error, but may cause performance issues", .{});
|
||||||
|
}
|
||||||
|
|
||||||
// Build up the list of fds we're going to poll. We are looking
|
// Build up the list of fds we're going to poll. We are looking
|
||||||
// for data on the pty and our quit notification.
|
// for data on the pty and our quit notification.
|
||||||
@ -1003,6 +1006,11 @@ const ReadThread = struct {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// This happens on macOS instead of WouldBlock when the
|
||||||
|
// child process dies. To be safe, we just break the loop
|
||||||
|
// and let our poll happen.
|
||||||
|
if (n == 0) break;
|
||||||
|
|
||||||
// log.info("DATA: {d}", .{n});
|
// log.info("DATA: {d}", .{n});
|
||||||
@call(.always_inline, process, .{ ev, buf[0..n] });
|
@call(.always_inline, process, .{ ev, buf[0..n] });
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user