@@ -39,6 +39,7 @@ export default class DefaultReporter extends BaseReporter {
3939 private readonly _out : write ;
4040 private readonly _status : Status ;
4141 private readonly _bufferedOutput : Set < FlushBufferedOutput > ;
42+ private readonly _bufferedOutput : Set < FlushBufferedOutput > ;
4243
4344 static readonly filename = __filename ;
4445
@@ -53,10 +54,14 @@ export default class DefaultReporter extends BaseReporter {
5354 this . __wrapStdio ( process . stdout ) ;
5455 this . __wrapStdio ( process . stderr ) ;
5556 this . _status . onChange ( ( ) => {
56- this . __beginSynchronizedUpdate ( ) ;
57+ this . __beginSynchronizedUpdate (
58+ this . _globalConfig . useStderr ? this . _err : this . _out ,
59+ ) ;
5760 this . __clearStatus ( ) ;
5861 this . __printStatus ( ) ;
59- this . __endSynchronizedUpdate ( ) ;
62+ this . __endSynchronizedUpdate (
63+ this . _globalConfig . useStderr ? this . _err : this . _out ,
64+ ) ;
6065 } ) ;
6166 }
6267
@@ -71,13 +76,17 @@ export default class DefaultReporter extends BaseReporter {
7176 buffer = [ ] ;
7277
7378 // This is to avoid conflicts between random output and status text
74- this . __beginSynchronizedUpdate ( ) ;
79+ this . __beginSynchronizedUpdate (
80+ this . _globalConfig . useStderr ? this . _err : this . _out ,
81+ ) ;
7582 this . __clearStatus ( ) ;
7683 if ( string ) {
7784 write ( string ) ;
7885 }
7986 this . __printStatus ( ) ;
80- this . __endSynchronizedUpdate ( ) ;
87+ this . __endSynchronizedUpdate (
88+ this . _globalConfig . useStderr ? this . _err : this . _out ,
89+ ) ;
8190
8291 this . _bufferedOutput . delete ( flushBufferedOutput ) ;
8392 } ;
@@ -124,26 +133,6 @@ export default class DefaultReporter extends BaseReporter {
124133 }
125134 }
126135
127- protected __beginSynchronizedUpdate ( ) : void {
128- if ( isInteractive ) {
129- if ( this . _globalConfig . useStderr ) {
130- this . _err ( '\x1b[?2026h' ) ;
131- } else {
132- this . _out ( '\x1b[?2026h' ) ;
133- }
134- }
135- }
136-
137- protected __endSynchronizedUpdate ( ) : void {
138- if ( isInteractive ) {
139- if ( this . _globalConfig . useStderr ) {
140- this . _err ( '\x1b[?2026l' ) ;
141- } else {
142- this . _out ( '\x1b[?2026l' ) ;
143- }
144- }
145- }
146-
147136 protected __printStatus ( ) : void {
148137 const { content, clear} = this . _status . get ( ) ;
149138 this . _clear = clear ;
0 commit comments