From 5a2a275aab57acfe8e85ca915fc6f323a652b432 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Wed, 13 Apr 2016 12:35:38 +0000 Subject: experimental UI: only redraw progress bar after event in curses mode Whenever an event has to be reported to the scroll-back buffer, the old progress bar has to be removed first. Afterwards, it is redrawn. In a setting without cursor control, this, however, litters the log with lots status bars. Therefore, only redraw the progress bar after an event if cursor control is available. Note that the refresh thread will eventually ensure an up-to-date progress bar anyway. -- MOS_MIGRATED_REVID=119737382 --- .../devtools/build/lib/runtime/ExperimentalEventHandler.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/google/devtools/build/lib/runtime/ExperimentalEventHandler.java b/src/main/java/com/google/devtools/build/lib/runtime/ExperimentalEventHandler.java index ad0817e665..db0c557d00 100644 --- a/src/main/java/com/google/devtools/build/lib/runtime/ExperimentalEventHandler.java +++ b/src/main/java/com/google/devtools/build/lib/runtime/ExperimentalEventHandler.java @@ -112,7 +112,9 @@ public class ExperimentalEventHandler extends BlazeCommandEventHandler { } stream.flush(); if (!buildComplete) { - addProgressBar(); + if (cursorControl) { + addProgressBar(); + } terminal.flush(); } break; @@ -253,7 +255,9 @@ public class ExperimentalEventHandler extends BlazeCommandEventHandler { crlf(); } crlf(); - addProgressBar(); + if (cursorControl) { + addProgressBar(); + } terminal.flush(); } catch (IOException e) { LOG.warning("IO Error writing to output stream: " + e); -- cgit v1.2.3