diff options
| author | Veikka Tuominen <git@vexu.eu> | 2023-01-04 16:54:46 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-04 16:54:46 +0200 |
| commit | 83fd45d82074eb8e6f914c8bb540927440897d6f (patch) | |
| tree | 0b2cc180fa12d618ed940ec7a530f159afac26db /src | |
| parent | 2b9478ce12a5556a9ef596d98a14347be8daee4a (diff) | |
| parent | 95fe23f572e30358d037301abf0eb82b6b61bdf8 (diff) | |
| download | zig-83fd45d82074eb8e6f914c8bb540927440897d6f.tar.gz zig-83fd45d82074eb8e6f914c8bb540927440897d6f.zip | |
Merge pull request #13786 from ziglang/tty-detection
stage2: make --color on affect progress bar too
Diffstat (limited to 'src')
| -rw-r--r-- | src/Compilation.zig | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index 3aa9663ed5..8249a8e9db 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -2358,7 +2358,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); |
