Skip to content

Instantly share code, notes, and snippets.

@LemonBoy
Created April 29, 2020 16:14
Show Gist options
  • Save LemonBoy/8eb8cf799dfcf6373692f0e824b1e91c to your computer and use it in GitHub Desktop.
Save LemonBoy/8eb8cf799dfcf6373692f0e824b1e91c to your computer and use it in GitHub Desktop.
diff --git a/lib/std/progress.zig b/lib/std/progress.zig
index bde67f1a2..e07f275b3 100644
--- a/lib/std/progress.zig
+++ b/lib/std/progress.zig
@@ -138,7 +138,7 @@ pub const Progress = struct {
// restore the cursor position by moving the cursor
// `columns_written` cells to the left, then clear the rest of the
// line
- if (std.builtin.os.tag != .windows) {
+ if (file.supportsAnsiEscapeCodes()) {
end += (std.fmt.bufPrint(self.output_buffer[end..], "\x1b[{}D", .{self.columns_written}) catch unreachable).len;
end += (std.fmt.bufPrint(self.output_buffer[end..], "\x1b[0K", .{}) catch unreachable).len;
} else {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment