| ... | @@ -57,6 +57,8 @@ output_buffer_slice: []u8 = undefined, | ... | @@ -57,6 +57,8 @@ output_buffer_slice: []u8 = undefined, |
| 57 | /// | 57 | /// |
| 58 | /// It is recommended to leave this as `null` so that `start` can automatically decide an | 58 | /// It is recommended to leave this as `null` so that `start` can automatically decide an |
| 59 | /// optimal width for the terminal. | 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 | max_width: ?usize = null, | 62 | max_width: ?usize = null, |
| 61 | | 63 | |
| 62 | /// How many nanoseconds between writing updates to the terminal. | 64 | /// How many nanoseconds between writing updates to the terminal. |
| ... | @@ -156,9 +158,13 @@ pub const Node = struct { | ... | @@ -156,9 +158,13 @@ pub const Node = struct { |
| 156 | | 158 | |
| 157 | /// Create a new progress node. | 159 | /// Create a new progress node. |
| 158 | /// Call `Node.end` when done. | 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 | /// `estimated_total_items` value of 0 means unknown. | 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 | pub fn start(self: *Progress, name: []const u8, estimated_total_items: usize) *Node { | 168 | pub fn start(self: *Progress, name: []const u8, estimated_total_items: usize) *Node { |
| 163 | const stderr = std.io.getStdErr(); | 169 | const stderr = std.io.getStdErr(); |
| 164 | self.terminal = null; | 170 | self.terminal = null; |