@@ -39,6 +39,7 @@ export default class DefaultReporter extends BaseReporter {
39
39
private readonly _out : write ;
40
40
private readonly _status : Status ;
41
41
private readonly _bufferedOutput : Set < FlushBufferedOutput > ;
42
+ private readonly _bufferedOutput : Set < FlushBufferedOutput > ;
42
43
43
44
static readonly filename = __filename ;
44
45
@@ -53,10 +54,14 @@ export default class DefaultReporter extends BaseReporter {
53
54
this . __wrapStdio ( process . stdout ) ;
54
55
this . __wrapStdio ( process . stderr ) ;
55
56
this . _status . onChange ( ( ) => {
56
- this . __beginSynchronizedUpdate ( ) ;
57
+ this . __beginSynchronizedUpdate (
58
+ this . _globalConfig . useStderr ? this . _err : this . _out ,
59
+ ) ;
57
60
this . __clearStatus ( ) ;
58
61
this . __printStatus ( ) ;
59
- this . __endSynchronizedUpdate ( ) ;
62
+ this . __endSynchronizedUpdate (
63
+ this . _globalConfig . useStderr ? this . _err : this . _out ,
64
+ ) ;
60
65
} ) ;
61
66
}
62
67
@@ -71,13 +76,17 @@ export default class DefaultReporter extends BaseReporter {
71
76
buffer = [ ] ;
72
77
73
78
// 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
+ ) ;
75
82
this . __clearStatus ( ) ;
76
83
if ( string ) {
77
84
write ( string ) ;
78
85
}
79
86
this . __printStatus ( ) ;
80
- this . __endSynchronizedUpdate ( ) ;
87
+ this . __endSynchronizedUpdate (
88
+ this . _globalConfig . useStderr ? this . _err : this . _out ,
89
+ ) ;
81
90
82
91
this . _bufferedOutput . delete ( flushBufferedOutput ) ;
83
92
} ;
@@ -124,26 +133,6 @@ export default class DefaultReporter extends BaseReporter {
124
133
}
125
134
}
126
135
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
-
147
136
protected __printStatus ( ) : void {
148
137
const { content, clear} = this . _status . get ( ) ;
149
138
this . _clear = clear ;
0 commit comments