Commit 81e54147 authored by Paul Wise's avatar Paul Wise Committed by Chris Lamb

Use the ProgressBar's idea of the terminal width instead

More likely to overwrite the correct number of characters. Fixes: commit dfb0c190
parent dfb0c190
......@@ -232,10 +232,8 @@ class ProgressBar(object):
if self.erase_to_eol:
self.fd.buffer.write(self.erase_to_eol)
elif self.fd.isatty():
from shutil import get_terminal_size
width = get_terminal_size().columns
print(end='\r', file=self.fd)
print(' ' * width, end='', file=self.fd)
print(' ' * self.term_width, end='', file=self.fd)
else:
# Do not flush if nothing was written
return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment