Skip to content

Commit 0ce958c

Browse files
kinfuykinfuy
kinfuy
authored and
kinfuy
committed
fix: Ctrl+C no longer kills processes (#11434)
1 parent 2c38bae commit 0ce958c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

packages/vite/src/node/shortcuts.ts

+9-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ export function bindShortcuts(
4444
const onInput = async (input: string) => {
4545
// ctrl+c or ctrl+d
4646
if (input === '\x03' || input === '\x04') {
47-
process.emit('SIGTERM')
48-
return
47+
// process.emit('SIGTERM')
48+
process.exit(1)
4949
}
5050

5151
if (actionRunning) return
@@ -112,6 +112,13 @@ const BASE_SHORTCUTS: CLIShortcut[] = [
112112
openBrowser(url, true, server.config.logger)
113113
},
114114
},
115+
{
116+
key: 'c',
117+
description: 'clear console',
118+
async action(server) {
119+
server.config.logger.clearScreen('error')
120+
},
121+
},
115122
{
116123
key: 'q',
117124
description: 'quit',

0 commit comments

Comments
 (0)