We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bb1d47a commit 9021612Copy full SHA for 9021612
packages/slidev/node/cli.ts
@@ -281,7 +281,7 @@ cli.command(
281
if (process.stdin.isTTY)
282
process.stdin.setRawMode(true)
283
284
- process.stdin.on('keypress', (str, key) => {
+ const onKeyPress = (str: string, key: { ctrl: boolean, name: string }) => {
285
if (key.ctrl && key.name === 'c') {
286
process.exit()
287
}
@@ -296,6 +296,11 @@ cli.command(
296
297
298
299
+ }
300
+
301
+ process.stdin.on('keypress', onKeyPress)
302
+ server?.httpServer?.on('close', () => {
303
+ process.stdin.off('keypress', onKeyPress)
304
})
305
306
0 commit comments