diff options
| author | jacob gw <jacoblevgw@gmail.com> | 2021-02-01 09:18:52 -0500 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2021-02-21 12:12:17 +0200 |
| commit | 1bd434fd18e0cb769ca46849dac056a562ce7ce3 (patch) | |
| tree | 8e65f447eb22547c4f69fb790f05a2fd77fd31e5 /src | |
| parent | 840331ee48e54b1ce4a3c8196f90eec73ce6deea (diff) | |
| download | zig-1bd434fd18e0cb769ca46849dac056a562ce7ce3.tar.gz zig-1bd434fd18e0cb769ca46849dac056a562ce7ce3.zip | |
std.Progress: improve support for "dumb" terminals
Diffstat (limited to 'src')
| -rw-r--r-- | src/Compilation.zig | 4 | ||||
| -rw-r--r-- | src/stage1.zig | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index ae3385b2dc..180d49a196 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -1538,7 +1538,9 @@ pub fn getCompileLogOutput(self: *Compilation) []const u8 { } pub fn performAllTheWork(self: *Compilation) error{ TimerUnsupported, OutOfMemory }!void { - var progress: std.Progress = .{}; + // If the terminal is dumb, we dont want to show the user all the + // output. + var progress: std.Progress = .{ .dont_print_on_dumb = true }; var main_progress_node = try progress.start("", 0); defer main_progress_node.end(); if (self.color == .off) progress.terminal = null; diff --git a/src/stage1.zig b/src/stage1.zig index 8ab3b1d94d..1b7eadd1a8 100644 --- a/src/stage1.zig +++ b/src/stage1.zig @@ -278,7 +278,9 @@ export fn stage2_attach_segfault_handler() void { // ABI warning export fn stage2_progress_create() *std.Progress { const ptr = std.heap.c_allocator.create(std.Progress) catch @panic("out of memory"); - ptr.* = std.Progress{}; + // If the terminal is dumb, we dont want to show the user all the + // output. + ptr.* = std.Progress{ .dont_print_on_dumb = true }; return ptr; } |
