aboutsummaryrefslogtreecommitdiff
path: root/src/main.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-04-09 00:19:44 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-04-09 00:19:44 -0700
commit9a2de796bd0eb047ca9bd23940004f3b25ab6625 (patch)
tree473870b356590dc0631e9a809403e180190d23e1 /src/main.zig
parent0f105ea3249068441a94c0e783b3ca27a06a783b (diff)
downloadzig-9a2de796bd0eb047ca9bd23940004f3b25ab6625.tar.gz
zig-9a2de796bd0eb047ca9bd23940004f3b25ab6625.zip
stage2: clean up pretty printing compile errors
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main.zig b/src/main.zig
index 032703a460..11857fff22 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -2106,8 +2106,12 @@ fn updateModule(gpa: *Allocator, comp: *Compilation, hook: AfterUpdateHook) !voi
defer errors.deinit(comp.gpa);
if (errors.list.len != 0) {
+ const ttyconf: std.debug.TTY.Config = switch (comp.color) {
+ .auto, .on => std.debug.detectTTYConfig(),
+ .off => .no_color,
+ };
for (errors.list) |full_err_msg| {
- try full_err_msg.renderToStdErr(comp.bin_file.options.module);
+ full_err_msg.renderToStdErr(ttyconf);
}
const log_text = comp.getCompileLogOutput();
if (log_text.len != 0) {