From d69398d3faf751bf560ee4ed24bea3140955f138 Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Mon, 4 Mar 2024 23:08:26 -0800 Subject: [PATCH] Handle edgecase in is_atty --- src/bun.js/event_loop.zig | 3 +++ src/bun.js/rare_data.zig | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/bun.js/event_loop.zig b/src/bun.js/event_loop.zig index 308d42b096..a849be80ba 100644 --- a/src/bun.js/event_loop.zig +++ b/src/bun.js/event_loop.zig @@ -1279,6 +1279,9 @@ pub const EventLoop = struct { } } else { loop.tickWithoutIdle(); + if (comptime Environment.isDebug) { + log("tickWithoutIdle", .{}); + } } this.flushImmediateQueue(); diff --git a/src/bun.js/rare_data.zig b/src/bun.js/rare_data.zig index ca57c9bb3e..1d09c9c4f2 100644 --- a/src/bun.js/rare_data.zig +++ b/src/bun.js/rare_data.zig @@ -350,7 +350,7 @@ pub fn stdin(rare: *RareData) *Blob.Store { .pathlike = .{ .fd = fd, }, - .is_atty = std.os.isatty(bun.STDIN_FD.cast()), + .is_atty = if (bun.STDIN_FD.isValid()) std.os.isatty(bun.STDIN_FD.cast()) else false, .mode = mode, }, },