Skip to content

Commit

Permalink
fix: skip shortcuts on non-tty stdin (#11263)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudBarre authored Dec 8, 2022
1 parent 962e593 commit 9602686
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/vite/src/node/shortcuts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ export function bindShortcuts(
server: ViteDevServer,
opts: BindShortcutsOptions,
): void {
if (!server.httpServer) return
if (!server.httpServer || !process.stdin.isTTY || process.env.CI) {
return
}
server._shortcutsOptions = opts

if (opts.print) {
Expand Down Expand Up @@ -71,9 +73,7 @@ export function bindShortcuts(
actionRunning = false
}

if (process.stdin.isTTY) {
process.stdin.setRawMode(true)
}
process.stdin.setRawMode(true)

process.stdin.on('data', onInput).setEncoding('utf8').resume()

Expand Down

0 comments on commit 9602686

Please sign in to comment.