authorgravatar for 4678790+dweiller@users.noreply.github.comDominic <4678790+dweiller@users.noreply.github.com> 2023-06-22 10:14:36+10:00
committergravatar for 4678790+dweiller@users.noreply.github.comDominic <4678790+dweiller@users.noreply.github.com> 2023-06-22 10:29:45+10:00
loge45d24c0de29eb6668e56ea927e15505674833a6
tree22f846a9598c189d37e8b15aaf39ef049ea43de4
parente05412669c8dde1230612de5af64fbc3fb0bc17e

rename ZIG_DEBUG_COLOR env variable to YES_COLOR


4 files changed, 5 insertions(+), 5 deletions(-)

doc/docgen.zig+1-1
...@@ -1305,7 +1305,7 @@ fn genHtml(...@@ -1305,7 +1305,7 @@ fn genHtml(
1305 defer root_node.end();1305 defer root_node.end();
13061306
1307 var env_map = try process.getEnvMap(allocator);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");
13091309
1310 const host = try std.zig.system.NativeTargetInfo.detect(.{});1310 const host = try std.zig.system.NativeTargetInfo.detect(.{});
1311 const builtin_code = try getBuiltinCode(allocator, &env_map, zig_exe, opt_zig_lib_dir);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,7 +282,7 @@ pub fn main() !void {
282 const ttyconf = get_tty_conf(color, stderr);282 const ttyconf = get_tty_conf(color, stderr);
283 switch (ttyconf) {283 switch (ttyconf) {
284 .no_color => try builder.env_map.put("NO_COLOR", "1"),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 .windows_api => {},286 .windows_api => {},
287 }287 }
288288
lib/std/io/tty.zig+2-2
...@@ -7,11 +7,11 @@ const native_os = builtin.os.tag;...@@ -7,11 +7,11 @@ const native_os = builtin.os.tag;
77
8/// Detect suitable TTY configuration options for the given file (commonly stdout/stderr).8/// Detect suitable TTY configuration options for the given file (commonly stdout/stderr).
9/// This includes feature checks for ANSI escape codes and the Windows console API, as well as9/// 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.
11pub fn detectConfig(file: File) Config {11pub fn detectConfig(file: File) Config {
12 const force_color: ?bool = if (builtin.os.tag == .wasi)12 const force_color: ?bool = if (builtin.os.tag == .wasi)
13 null // wasi does not support environment variables13 null // wasi does not support environment variables
14 else if (process.hasEnvVarConstant("ZIG_DEBUG_COLOR"))14 else if (process.hasEnvVarConstant("NO_COLOR"))
15 false15 false
16 else if (process.hasEnvVarConstant("YES_COLOR"))16 else if (process.hasEnvVarConstant("YES_COLOR"))
17 true17 true
test/src/StackTrace.zig+1-1
...@@ -81,7 +81,7 @@ fn addExpect(...@@ -81,7 +81,7 @@ fn addExpect(
81 });81 });
8282
83 const run = b.addRunArtifact(exe);83 const run = b.addRunArtifact(exe);
84 run.removeEnvironmentVariable("ZIG_DEBUG_COLOR");84 run.removeEnvironmentVariable("YES_COLOR");
85 run.setEnvironmentVariable("NO_COLOR", "1");85 run.setEnvironmentVariable("NO_COLOR", "1");
86 run.expectExitCode(1);86 run.expectExitCode(1);
87 run.expectStdOutEqual("");87 run.expectStdOutEqual("");