From 718fc1d087745efe227cc20817756e0129b330f1 Mon Sep 17 00:00:00 2001 From: kinfuy <37766068+kinfuy@users.noreply.github.com> Date: Tue, 3 Jan 2023 01:17:34 +0800 Subject: [PATCH] fix(cli): ctrl+C no longer kills processes (#11434) (#11518) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Arnaud Barré close https://github.com/vitejs/vite/issues/11434 --- packages/vite/src/node/shortcuts.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/vite/src/node/shortcuts.ts b/packages/vite/src/node/shortcuts.ts index a34c96f3f6a3c5..6c35953c5af8ac 100644 --- a/packages/vite/src/node/shortcuts.ts +++ b/packages/vite/src/node/shortcuts.ts @@ -44,7 +44,8 @@ export function bindShortcuts( const onInput = async (input: string) => { // ctrl+c or ctrl+d if (input === '\x03' || input === '\x04') { - process.emit('SIGTERM') + process.stdin.setRawMode(false) + process.stdin.write(input) return }