summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2015-12-07 18:26:57 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-12-08 10:31:48 +0000
commitf9384b0669a5d281e0d251060c453a2b228ea878 (patch)
treee93cdd7ea0a369d3f52f1355bcf509bad9ba250a
parent7a775a1c46dd6f19bf5d4b0bdc8c9a20bc2bea50 (diff)
downloadpoky-f9384b0669a5d281e0d251060c453a2b228ea878.tar.gz
poky-f9384b0669a5d281e0d251060c453a2b228ea878.tar.bz2
poky-f9384b0669a5d281e0d251060c453a2b228ea878.zip
bitbake: knotty: Enforce terminal line limit to stop crazy scrolling
If there are more tasks running than there are lines on the terminal, the data scrolls in ways the UI wasn't designed for. This patch adjusts the UI just to show the processes which fit onto the number of rows in the terminal window. You can see the total number running from the counter in the top left as usual and this makes warning and errors messages scrolling from the top of the window work as designed. Ultimately, scrolling would be nice but is for another time, this fixes the biggest UI issue on highly parallel machines. (Bitbake rev: 67b77658e2bfa849f6f55c9c262cb11d6bfdb399) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/ui/knotty.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py
index 90c3183767..c3d73b9540 100644
--- a/bitbake/lib/bb/ui/knotty.py
+++ b/bitbake/lib/bb/ui/knotty.py
@@ -104,10 +104,11 @@ class InteractConsoleLogFilter(logging.Filter):
return True
class TerminalFilter(object):
+ rows = 25
columns = 80
def sigwinch_handle(self, signum, frame):
- self.columns = self.getTerminalColumns()
+ self.rows, self.columns = self.getTerminalColumns()
if self._sigwinch_default:
self._sigwinch_default(signum, frame)
@@ -131,7 +132,7 @@ class TerminalFilter(object):
cr = (env['LINES'], env['COLUMNS'])
except:
cr = (25, 80)
- return cr[1]
+ return cr
def __init__(self, main, helper, console, errconsole, format):
self.main = main
@@ -207,7 +208,7 @@ class TerminalFilter(object):
content = "Currently %s running tasks (%s of %s):" % (len(activetasks), self.helper.tasknumber_current, self.helper.tasknumber_total)
print(content)
lines = 1 + int(len(content) / (self.columns + 1))
- for tasknum, task in enumerate(tasks):
+ for tasknum, task in enumerate(tasks[:(self.rows - 2)]):
content = "%s: %s" % (tasknum, task)
print(content)
lines = lines + 1 + int(len(content) / (self.columns + 1))