From 3754646b75bd80636107fcb77868b934acb3dd47 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 28 Nov 2018 15:52:15 +0900 Subject: [PATCH] Use VT100 sequence to erase previous line --- lib/rdoc/stats/normal.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rdoc/stats/normal.rb b/lib/rdoc/stats/normal.rb index a3a6ff377e..41e6040452 100644 --- a/lib/rdoc/stats/normal.rb +++ b/lib/rdoc/stats/normal.rb @@ -42,7 +42,7 @@ def print_file files_so_far, filename if $stdout.tty? # Clean the line with whitespaces so that leftover output from the # previous line doesn't show up. - $stdout.print("\r" + (" " * @last_width) + ("\b" * @last_width) + "\r") if @last_width && @last_width > 0 + $stdout.print("\r\e[K") if @last_width && @last_width > 0 @last_width = line.size $stdout.print("#{line}\r") else