File tree 1 file changed +9
-2
lines changed
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -305,16 +305,23 @@ TaskReporter_.prototype.log_ = function(data) {
305
305
tag += ( ' #' + this . task . taskId ) ;
306
306
tag += '] ' ;
307
307
308
-
309
308
data = data . toString ( ) ;
310
309
for ( var i = 0 ; i < data . length ; i ++ ) {
311
310
if ( this . insertTag ) {
312
311
this . insertTag = false ;
312
+ // This ensures that the '\x1B[0m' appears before the tag, so that
313
+ // data remains correct when color is not processed.
314
+ // See https://github.com/angular/protractor/pull/1216
315
+ if ( data [ i ] === '\x1B' && data . substring ( i , i + 4 ) === '\x1B[0m' ) {
316
+ this . buffer += ( '\x1B[0m' + tag ) ;
317
+ i += 3 ;
318
+ continue ;
319
+ }
320
+
313
321
this . buffer += tag ;
314
322
}
315
323
if ( data [ i ] === '\n' ) {
316
324
this . insertTag = true ;
317
- this . buffer += '\x1B[0m' ; // Prevent color from leaking into next line
318
325
}
319
326
this . buffer += data [ i ] ;
320
327
}
You can’t perform that action at this time.
0 commit comments