Skip to content

Commit f3a6379

Browse files
committed
fix issue where color formatting text is leaking
See angular#1131
1 parent 316961c commit f3a6379

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/launcher.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -310,11 +310,17 @@ TaskReporter_.prototype.log_ = function(data) {
310310
for ( var i = 0; i < data.length; i++ ) {
311311
if (this.insertTag) {
312312
this.insertTag = false;
313+
if (data[i] === '\x1B' && data.substring(i, i+4) === '\x1B[0m' ) {
314+
// Prevent coloring tag
315+
this.buffer += ('\x1B[0m' + tag);
316+
i += 3;
317+
continue;
318+
}
319+
313320
this.buffer += tag;
314321
}
315322
if (data[i] === '\n') {
316323
this.insertTag = true;
317-
this.buffer += '\x1B[0m'; // Prevent color from leaking into next line
318324
}
319325
this.buffer += data[i];
320326
}

0 commit comments

Comments
 (0)