diff --git a/bin/main.js b/bin/main.js index 76051eb626..43da5789e8 100644 --- a/bin/main.js +++ b/bin/main.js @@ -35,9 +35,13 @@ export async function main(nodeProcess) { const helpText = await readFile(resolve(__dirname, '../man/marked.1.md'), 'utf8'); await new Promise(res => { - spawn('man', [resolve(__dirname, '../man/marked.1')], options) - .on('error', () => { - console.log(helpText); + const manProcess = spawn('man', [resolve(__dirname, '../man/marked.1')], options); + nodeProcess.on('SIGINT', () => { + manProcess.kill('SIGINT'); + }); + + manProcess.on('error', () => { + console.log(helpText); }) .on('close', res); });