Skip to content

Commit

Permalink
use terminal synchronized update sequences
Browse files Browse the repository at this point in the history
  • Loading branch information
gvilums committed Apr 11, 2024
1 parent c9ff770 commit 5083cf6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/cli/filter_run.zig
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ const State = struct {
fn redraw(this: *This, is_abort: bool) !void {
if (!this.pretty_output) return;
this.draw_buf.clearRetainingCapacity();
try this.draw_buf.appendSlice("\x1b[?2026h");
if (this.last_lines_written > 0) {
// move cursor to the beginning of the line and clear it
try this.draw_buf.appendSlice("\x1b[0G\x1b[K");
Expand Down Expand Up @@ -330,6 +331,7 @@ const State = struct {
try this.draw_buf.writer().print(fmt("<cyan><d>Waiting for {d} other script(s)<r>\n"), .{handle.remaining_dependencies});
}
}
try this.draw_buf.appendSlice("\x1b[?2026l");
this.last_lines_written = 0;
for (this.draw_buf.items) |c| {
if (c == '\n') {
Expand Down

0 comments on commit 5083cf6

Please sign in to comment.