commit 3dcdd5544faf9891e2e20391f4da2b42381f79ba (tree) parent 55ca43a04c6273d3b68c4b5a40f8576c106de5e7 Author: Andrew Kelley <andrew@ziglang.org> Date: Thu, 10 Nov 2022 14:01:47 -0700 stage2: make --color override apply to std.Progress Diffstat:
| M | src/Compilation.zig | | | 11 | ++++++++++- |
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/Compilation.zig b/src/Compilation.zig @@ -2380,7 +2380,16 @@ pub fn update(comp: *Compilation) !void { var progress: std.Progress = .{ .dont_print_on_dumb = true }; const main_progress_node = progress.start("", 0); defer main_progress_node.end(); - if (comp.color == .off) progress.terminal = null; + switch (comp.color) { + .off => { + progress.terminal = null; + }, + .on => { + progress.terminal = std.io.getStdErr(); + progress.supports_ansi_escape_codes = true; + }, + .auto => {}, + } try comp.performAllTheWork(main_progress_node);