diff --git a/gitinspector/terminal.py b/gitinspector/terminal.py index 38176df..4d65711 100644 --- a/gitinspector/terminal.py +++ b/gitinspector/terminal.py @@ -148,6 +148,11 @@ def rjust(string, pad): def output_progress(text, pos, length): if sys.stdout.isatty(): - clear_row() - print(text.format(100 * pos / length), end="") + (width, _unused) = get_size() + progress_text = text.format(100 * pos / length) + + if len(progress_text) > width: + progress_text = "...%s" % progress_text[-width+3:] + + print("\r{0}\r{1}".format(" " * width, progress_text), end="") sys.stdout.flush()