aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommand.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommand.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommand.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommand.java b/src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommand.java
index 715ef0e385..16ed00abe9 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommand.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommand.java
@@ -305,6 +305,10 @@ public class RunCommand implements BlazeCommand {
.addArgs(cmdLine).setEnv(runtime.getClientEnv()).setWorkingDir(workingDir).build();
try {
+ // Restore a raw EventHandler if it is registered. This allows for blaze run to produce the
+ // actual output of the command being run even if --color=no is specified.
+ runtime.getReporter().switchToAnsiAllowingHandler();
+
// The command API is a little strange in that the following statement
// will return normally only if the program exits with exit code 0.
// If it ends with any other code, we have to catch BadExitStatusException.