| ... | @@ -145,7 +145,7 @@ pub const Progress = struct { | ... | @@ -145,7 +145,7 @@ pub const Progress = struct { |
| 145 | if (self.supports_ansi_escape_codes) { | 145 | if (self.supports_ansi_escape_codes) { |
| 146 | end += (std.fmt.bufPrint(self.output_buffer[end..], "\x1b[{}D", .{self.columns_written}) catch unreachable).len; | 146 | end += (std.fmt.bufPrint(self.output_buffer[end..], "\x1b[{}D", .{self.columns_written}) catch unreachable).len; |
| 147 | end += (std.fmt.bufPrint(self.output_buffer[end..], "\x1b[0K", .{}) catch unreachable).len; | 147 | end += (std.fmt.bufPrint(self.output_buffer[end..], "\x1b[0K", .{}) catch unreachable).len; |
| 148 | } else if (std.builtin.os.tag == .windows) { | 148 | } else if (std.builtin.os.tag == .windows) winapi: { |
| 149 | var info: windows.CONSOLE_SCREEN_BUFFER_INFO = undefined; | 149 | var info: windows.CONSOLE_SCREEN_BUFFER_INFO = undefined; |
| 150 | if (windows.kernel32.GetConsoleScreenBufferInfo(file.handle, &info) != windows.TRUE) | 150 | if (windows.kernel32.GetConsoleScreenBufferInfo(file.handle, &info) != windows.TRUE) |
| 151 | unreachable; | 151 | unreachable; |
| ... | @@ -167,7 +167,11 @@ pub const Progress = struct { | ... | @@ -167,7 +167,11 @@ pub const Progress = struct { |
| 167 | fill_chars, | 167 | fill_chars, |
| 168 | cursor_pos, | 168 | cursor_pos, |
| 169 | &written, | 169 | &written, |
| 170 | ) != windows.TRUE) unreachable; | 170 | ) != windows.TRUE) { |
| | 171 | // Stop trying to write to this file. |
| | 172 | self.terminal = null; |
| | 173 | break :winapi; |
| | 174 | } |
| 171 | if (windows.kernel32.FillConsoleOutputCharacterA( | 175 | if (windows.kernel32.FillConsoleOutputCharacterA( |
| 172 | file.handle, | 176 | file.handle, |
| 173 | ' ', | 177 | ' ', |