| ... | ... | @@ -57,6 +57,8 @@ output_buffer_slice: []u8 = undefined, |
| 57 | 57 | /// |
| 58 | 58 | /// It is recommended to leave this as `null` so that `start` can automatically decide an |
| 59 | 59 | /// optimal width for the terminal. |
| 60 | /// |
| 61 | /// Note that this will be clamped to at least 4 and output will appear malformed if it is < 4. |
| 60 | 62 | max_width: ?usize = null, |
| 61 | 63 | |
| 62 | 64 | /// How many nanoseconds between writing updates to the terminal. |
| ... | ... | @@ -156,9 +158,13 @@ pub const Node = struct { |
| 156 | 158 | |
| 157 | 159 | /// Create a new progress node. |
| 158 | 160 | /// Call `Node.end` when done. |
| 159 | | /// TODO solve https://github.com/ziglang/zig/issues/2765 and then change this |
| 160 | | /// API to return Progress rather than accept it as a parameter. |
| 161 | 161 | /// `estimated_total_items` value of 0 means unknown. |
| 162 | /// |
| 163 | /// Note that as soon as work is started and progress output is printed, |
| 164 | /// `std.Progress` expects you to lean back and wait and not resize the terminal. |
| 165 | /// Resizing the terminal during progress output may result in malformed output. |
| 166 | // TODO: solve https://github.com/ziglang/zig/issues/2765 and then change this |
| 167 | // API to return Progress rather than accept it as a parameter. |
| 162 | 168 | pub fn start(self: *Progress, name: []const u8, estimated_total_items: usize) *Node { |
| 163 | 169 | const stderr = std.io.getStdErr(); |
| 164 | 170 | self.terminal = null; |