Bug 1368057 - Clear terminal footer to end of line, not screen; r?glandium
bz reported that mach output was slow under xterm on Mac. He tracked
this down to the terminal footer clearing until end of screen. It's
likely this is triggering a vsync or repaint or something, as he measured
each line to take 16ms to display.
Changing the clearing operation from "end of screen" to "end of line"
should be a cheaper operation and should speed up terminal writing.
This code has been historically sensitive to change. There's a
non-insignificant risk this will break a terminal configuration. I've
tested this with PuTTY, terminal.app on OS X (including under screen),
and iTerm2.app and it seems to "just work."
MozReview-Commit-ID: C2sYYboksj1
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -139,17 +139,17 @@ class BuildProgressFooter(object):
# terminal is a blessings.Terminal.
self._t = terminal
self._fh = sys.stdout
self.tiers = monitor.tiers.tier_status.viewitems()
def clear(self):
"""Removes the footer from the current terminal."""
self._fh.write(self._t.move_x(0))
- self._fh.write(self._t.clear_eos())
+ self._fh.write(self._t.clear_eol())
def draw(self):
"""Draws this footer in the terminal."""
if not self.tiers:
return
# The drawn terminal looks something like: