Skip to content

Commit

Permalink
Update output.zig
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarred-Sumner committed Sep 26, 2024
1 parent 5f8872b commit 7927386
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/output.zig
Original file line number Diff line number Diff line change
Expand Up @@ -127,20 +127,15 @@ pub const Source = struct {
}

pub fn isColorTerminal() bool {
if (bun.getenvZ("COLORTERM")) |color_term| {
return !strings.eqlComptime(color_term, "0");
}
if (bun.getenvZ("TERM")) |term| {
return !strings.eqlComptime(term, "dumb");
}
if (Environment.isWindows) {
// https://github.com/chalk/supports-color/blob/d4f413efaf8da045c5ab440ed418ef02dbb28bf1/index.js#L100C11-L112
// Windows 10 build 10586 is the first Windows release that supports 256 colors.
// Windows 10 build 14931 is the first release that supports 16m/TrueColor.
// Every other version supports 16 colors.
return true;
}
return false;

return colorDepth() != .none;
}

export var bun_stdio_tty: [3]i32 = .{ 0, 0, 0 };
Expand Down Expand Up @@ -308,6 +303,7 @@ pub const Source = struct {
}
}

lazy_color_depth = .@"16";
return;
}

Expand Down

0 comments on commit 7927386

Please sign in to comment.