| ... | @@ -81,7 +81,7 @@ pub fn getSelfDebugInfo() !*DebugInfo { | ... | @@ -81,7 +81,7 @@ pub fn getSelfDebugInfo() !*DebugInfo { |
| 81 | } | 81 | } |
| 82 | } | 82 | } |
| 83 | | 83 | |
| 84 | fn detectTTYConfig() TTY.Config { | 84 | pub fn detectTTYConfig() TTY.Config { |
| 85 | var bytes: [128]u8 = undefined; | 85 | var bytes: [128]u8 = undefined; |
| 86 | const allocator = &std.heap.FixedBufferAllocator.init(bytes[0..]).allocator; | 86 | const allocator = &std.heap.FixedBufferAllocator.init(bytes[0..]).allocator; |
| 87 | if (process.getEnvVarOwned(allocator, "ZIG_DEBUG_COLOR")) |_| { | 87 | if (process.getEnvVarOwned(allocator, "ZIG_DEBUG_COLOR")) |_| { |
| ... | @@ -89,7 +89,7 @@ fn detectTTYConfig() TTY.Config { | ... | @@ -89,7 +89,7 @@ fn detectTTYConfig() TTY.Config { |
| 89 | } else |_| { | 89 | } else |_| { |
| 90 | if (stderr_file.supportsAnsiEscapeCodes()) { | 90 | if (stderr_file.supportsAnsiEscapeCodes()) { |
| 91 | return .escape_codes; | 91 | return .escape_codes; |
| 92 | } else if (builtin.os == .windows) { | 92 | } else if (builtin.os == .windows and stderr_file.isTty()) { |
| 93 | return .windows_api; | 93 | return .windows_api; |
| 94 | } else { | 94 | } else { |
| 95 | return .no_color; | 95 | return .no_color; |