| author | |
| committer | |
| log | e45d24c0de29eb6668e56ea927e15505674833a6 |
| tree | 22f846a9598c189d37e8b15aaf39ef049ea43de4 |
| parent | e05412669c8dde1230612de5af64fbc3fb0bc17e |
4 files changed, 5 insertions(+), 5 deletions(-)
doc/docgen.zig+1-1| ... | ... | @@ -1305,7 +1305,7 @@ fn genHtml( |
| 1305 | 1305 | defer root_node.end(); |
| 1306 | 1306 | |
| 1307 | 1307 | var env_map = try process.getEnvMap(allocator); |
| 1308 | try env_map.put("ZIG_DEBUG_COLOR", "1"); | |
| 1308 | try env_map.put("YES_COLOR", "1"); | |
| 1309 | 1309 | |
| 1310 | 1310 | const host = try std.zig.system.NativeTargetInfo.detect(.{}); |
| 1311 | 1311 | const builtin_code = try getBuiltinCode(allocator, &env_map, zig_exe, opt_zig_lib_dir); |
lib/build_runner.zig+1-1| ... | ... | @@ -282,7 +282,7 @@ pub fn main() !void { |
| 282 | 282 | const ttyconf = get_tty_conf(color, stderr); |
| 283 | 283 | switch (ttyconf) { |
| 284 | 284 | .no_color => try builder.env_map.put("NO_COLOR", "1"), |
| 285 | .escape_codes => try builder.env_map.put("ZIG_DEBUG_COLOR", "1"), | |
| 285 | .escape_codes => try builder.env_map.put("YES_COLOR", "1"), | |
| 286 | 286 | .windows_api => {}, |
| 287 | 287 | } |
| 288 | 288 |
lib/std/io/tty.zig+2-2| ... | ... | @@ -7,11 +7,11 @@ const native_os = builtin.os.tag; |
| 7 | 7 | |
| 8 | 8 | /// Detect suitable TTY configuration options for the given file (commonly stdout/stderr). |
| 9 | 9 | /// This includes feature checks for ANSI escape codes and the Windows console API, as well as |
| 10 | /// respecting the `ZIG_DEBUG_COLOR` and `YES_COLOR` environment variables to override the default. | |
| 10 | /// respecting the `NO_COLOR` and `YES_COLOR` environment variables to override the default. | |
| 11 | 11 | pub fn detectConfig(file: File) Config { |
| 12 | 12 | const force_color: ?bool = if (builtin.os.tag == .wasi) |
| 13 | 13 | null // wasi does not support environment variables |
| 14 | else if (process.hasEnvVarConstant("ZIG_DEBUG_COLOR")) | |
| 14 | else if (process.hasEnvVarConstant("NO_COLOR")) | |
| 15 | 15 | false |
| 16 | 16 | else if (process.hasEnvVarConstant("YES_COLOR")) |
| 17 | 17 | true |
test/src/StackTrace.zig+1-1| ... | ... | @@ -81,7 +81,7 @@ fn addExpect( |
| 81 | 81 | }); |
| 82 | 82 | |
| 83 | 83 | const run = b.addRunArtifact(exe); |
| 84 | run.removeEnvironmentVariable("ZIG_DEBUG_COLOR"); | |
| 84 | run.removeEnvironmentVariable("YES_COLOR"); | |
| 85 | 85 | run.setEnvironmentVariable("NO_COLOR", "1"); |
| 86 | 86 | run.expectExitCode(1); |
| 87 | 87 | run.expectStdOutEqual(""); |