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(
13051305 defer root_node.end();
13061306
13071307 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
13101310 const host = try std.zig.system.NativeTargetInfo.detect(.{});
13111311 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 {
282282 const ttyconf = get_tty_conf(color, stderr);
283283 switch (ttyconf) {
284284 .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"),
286286 .windows_api => {},
287287 }
288288
lib/std/io/tty.zig+2-2
......@@ -7,11 +7,11 @@ const native_os = builtin.os.tag;
77
88/// Detect suitable TTY configuration options for the given file (commonly stdout/stderr).
99/// 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.
1111pub fn detectConfig(file: File) Config {
1212 const force_color: ?bool = if (builtin.os.tag == .wasi)
1313 null // wasi does not support environment variables
14 else if (process.hasEnvVarConstant("ZIG_DEBUG_COLOR"))
14 else if (process.hasEnvVarConstant("NO_COLOR"))
1515 false
1616 else if (process.hasEnvVarConstant("YES_COLOR"))
1717 true
test/src/StackTrace.zig+1-1
......@@ -81,7 +81,7 @@ fn addExpect(
8181 });
8282
8383 const run = b.addRunArtifact(exe);
84 run.removeEnvironmentVariable("ZIG_DEBUG_COLOR");
84 run.removeEnvironmentVariable("YES_COLOR");
8585 run.setEnvironmentVariable("NO_COLOR", "1");
8686 run.expectExitCode(1);
8787 run.expectStdOutEqual("");