Skip to content

Commit

Permalink
fix(cli): do not capture stdin when in run mode (#4310)
Browse files Browse the repository at this point in the history
  • Loading branch information
AriPerkkio authored Oct 23, 2023
1 parent 28109cc commit fc51ad0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion packages/vitest/src/node/cli-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export async function startVitest(
}

let stdinCleanup
if (process.stdin.isTTY)
if (process.stdin.isTTY && ctx.config.watch)
stdinCleanup = registerConsoleShortcuts(ctx)

ctx.onServerRestart((reason) => {
Expand Down
4 changes: 0 additions & 4 deletions packages/vitest/src/node/stdin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ export function registerConsoleShortcuts(ctx: Vitest) {
return
}

// Other keys are for watch mode only
if (!ctx.config.watch)
return

const name = key?.name

if (ctx.runningPromise) {
Expand Down

0 comments on commit fc51ad0

Please sign in to comment.