mirror of
https://github.com/ziglang/zig.git
synced 2024-12-15 07:40:13 +00:00
fix regression in windows stack traces tty detection
This commit is contained in:
parent
96e5f476c3
commit
51ac8eb08e
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user