Skip to content

Commit 9602686

Browse files
authoredDec 8, 2022
fix: skip shortcuts on non-tty stdin (#11263)
1 parent 962e593 commit 9602686

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎packages/vite/src/node/shortcuts.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ export function bindShortcuts(
2121
server: ViteDevServer,
2222
opts: BindShortcutsOptions,
2323
): void {
24-
if (!server.httpServer) return
24+
if (!server.httpServer || !process.stdin.isTTY || process.env.CI) {
25+
return
26+
}
2527
server._shortcutsOptions = opts
2628

2729
if (opts.print) {
@@ -71,9 +73,7 @@ export function bindShortcuts(
7173
actionRunning = false
7274
}
7375

74-
if (process.stdin.isTTY) {
75-
process.stdin.setRawMode(true)
76-
}
76+
process.stdin.setRawMode(true)
7777

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

0 commit comments

Comments
 (0)
Please sign in to comment.