| author | |
| committer | |
| log | a31ff072d18a170d427d97a1e7fa1a5afe3b27bf |
| tree | 6b4f56393bdc77370d59d608a8ae504a16a509c8 |
| parent | 5bd69c655d9e04102c8a64ced1215c9d69f4f03f |
Before, --color on would affect colored compile error printing but not
affect terminal progress bar printing. It was intended for this option
to affect both; now it does.
This causes a failure when building the language reference, which
contains code for parsing terminal output and rendering HTML. Now it
must be expanded to handle 'K' and 'D' codes to simulate a terminal
cursor moving, and the CI will fail until that capability is added in a
later commit of this branch.
I extracted this change from #13560 so that the idea is not lost but we
can solve this issue separately.1 files changed, 10 insertions(+), 1 deletions(-)
src/Compilation.zig+10-1| ... | ... | @@ -2356,7 +2356,16 @@ pub fn update(comp: *Compilation) !void { |
| 2356 | 2356 | var progress: std.Progress = .{ .dont_print_on_dumb = true }; |
| 2357 | 2357 | const main_progress_node = progress.start("", 0); |
| 2358 | 2358 | defer main_progress_node.end(); |
| 2359 | if (comp.color == .off) progress.terminal = null; | |
| 2359 | switch (comp.color) { | |
| 2360 | .off => { | |
| 2361 | progress.terminal = null; | |
| 2362 | }, | |
| 2363 | .on => { | |
| 2364 | progress.terminal = std.io.getStdErr(); | |
| 2365 | progress.supports_ansi_escape_codes = true; | |
| 2366 | }, | |
| 2367 | .auto => {}, | |
| 2368 | } | |
| 2360 | 2369 | |
| 2361 | 2370 | try comp.performAllTheWork(main_progress_node); |
| 2362 | 2371 |