File tree 2 files changed +11
-6
lines changed
2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -149,6 +149,11 @@ export function registerConsoleShortcuts(
149
149
} )
150
150
151
151
on ( )
152
+
153
+ if ( typeof filter === 'undefined' ) {
154
+ return
155
+ }
156
+
152
157
const files = ctx . state . getFilepaths ( )
153
158
// if running in standalone mode, Vitest instance doesn't know about any test file
154
159
const cliFiles
@@ -193,6 +198,10 @@ export function registerConsoleShortcuts(
193
198
194
199
on ( )
195
200
201
+ if ( typeof filter === 'undefined' ) {
202
+ return
203
+ }
204
+
196
205
latestFilename = filter ?. trim ( ) || ''
197
206
const lastResults = watchFilter . getLastResults ( )
198
207
Original file line number Diff line number Diff line change @@ -74,9 +74,9 @@ export class WatchFilter {
74
74
break
75
75
case key ?. ctrl && key ?. name === 'c' :
76
76
case key ?. name === 'escape' :
77
- this . cancel ( )
77
+ this . write ( ` ${ ESC } 1G ${ ESC } 0J` ) // clean content
78
78
onSubmit ( undefined )
79
- break
79
+ return
80
80
case key ?. name === 'enter' :
81
81
case key ?. name === 'return' :
82
82
onSubmit (
@@ -224,10 +224,6 @@ export class WatchFilter {
224
224
this . write ( `${ ESC } ${ cursortPos } G` )
225
225
}
226
226
227
- private cancel ( ) {
228
- this . write ( `${ ESC } J` ) // erase down
229
- }
230
-
231
227
private write ( data : string ) {
232
228
// @ts -expect-error -- write() method has different signature on the union type
233
229
this . stdout . write ( data )
You can’t perform that action at this time.
0 commit comments