From 67e2bb3317d7ba5d216d103473ff2ebf3b038b6a 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 }