If the last output was a progress message, we would blank out the line
(which was correct) but then we'd print a newline, which was wrong. Only
print the leftover output, followed by a newline, if the last output was
nonempty.
'bup midx' suffered from this.
Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
else:
assert(len(l) == 3)
(line, splitchar, all) = l
- #splitchar = '\n'
sys.stdout.write('%-*s%s' % (lastlen, line, splitchar))
if splitchar == '\r':
lastlen = len(line)
lastlen = 0
sys.stdout.flush()
-if lastlen or all:
- sys.stdout.write('%-*s\n' % (lastlen, all))
+if lastlen:
+ sys.stdout.write('%-*s\r' % (lastlen, ''))
+if all:
+ sys.stdout.write('%s\n' % all)