Commit 51ac8eb08e
lib/std/debug.zig
@@ -81,7 +81,7 @@ pub fn getSelfDebugInfo() !*DebugInfo {
}
}
-fn detectTTYConfig() TTY.Config {
+pub fn detectTTYConfig() TTY.Config {
var bytes: [128]u8 = undefined;
const allocator = &std.heap.FixedBufferAllocator.init(bytes[0..]).allocator;
if (process.getEnvVarOwned(allocator, "ZIG_DEBUG_COLOR")) |_| {
@@ -89,7 +89,7 @@ fn detectTTYConfig() TTY.Config {
} else |_| {
if (stderr_file.supportsAnsiEscapeCodes()) {
return .escape_codes;
- } else if (builtin.os == .windows) {
+ } else if (builtin.os == .windows and stderr_file.isTty()) {
return .windows_api;
} else {
return .no_color;
test/tests.zig
@@ -622,6 +622,9 @@ pub const StackTracesContext = struct {
child.stderr_behavior = .Pipe;
child.env_map = b.env_map;
+ if (b.verbose) {
+ printInvocation(args.toSliceConst());
+ }
child.spawn() catch |err| debug.panic("Unable to spawn {}: {}\n", .{ full_exe_path, @errorName(err) });
var stdout = Buffer.initNull(b.allocator);