authorgravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2021-03-13 00:42:42+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-03-12 19:31:59-05:00
log8ebb18d9da0bfbe6a974636fd36e3391d1de253b
tree6228ec926490cfb4296f1a5e9ed5b9a2b39eee79
parentb83ef595a53377189d42bdb697af866f30838040

std: Use more common escape sequences in Progress

This should fix the badly-rendered progress message when run in Terminal.app.

1 files changed, 4 insertions(+), 2 deletions(-)

lib/std/Progress.zig+4-2
......@@ -185,9 +185,11 @@ pub fn refresh(self: *Progress) void {
185185// ED -- Clear screen
186186const ED = "\x1b[J";
187187// DECSC -- Save cursor position
188const DECSC = "\x1b[s";
188const DECSC = "\x1b7";
189189// DECRC -- Restore cursor position
190const DECRC = "\x1b[u";
190const DECRC = "\x1b8";
191// Note that ESC7/ESC8 are used instead of CSI s/CSI u as the latter are not
192// supported by some terminals (eg. Terminal.app).
191193
192194fn refreshWithHeldLock(self: *Progress) void {
193195 const is_dumb = !self.supports_ansi_escape_codes and !(std.builtin.os.tag == .windows);