Skip to content

Commit

Permalink
Clear all lines in interject_with
Browse files Browse the repository at this point in the history
  • Loading branch information
Gbury committed Jul 18, 2023
1 parent dd1f3cf commit 5bf9fe0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/progress/engine/renderer.ml
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,11 @@ end = struct
rerender_all_from_top ~stage:`tick ~starting_at:0 ~unconditional:false t

let interject_with ({ config = { ppf; _ }; rows; _ } as t) f =
Format.fprintf ppf "%a%s%!" Terminal.Ansi.move_up
(Vector.length rows - 1)
Terminal.Ansi.erase_line;
Format.fprintf ppf "%s%!" Terminal.Ansi.erase_line;
for _ = 1 to Vector.length rows - 1 do
Format.fprintf ppf "%a%s%!" Terminal.Ansi.move_up 1
Terminal.Ansi.erase_line
done;
Fun.protect f ~finally:(fun () ->
rerender_all_from_top ~stage:`update ~starting_at:0 ~unconditional:true
t)
Expand Down

0 comments on commit 5bf9fe0

Please sign in to comment.