From ec3abd8d9ebcf730f3205991f449cb27e9c1dead Mon Sep 17 00:00:00 2001 From: Lucas Terracino Date: Thu, 10 Oct 2024 17:06:28 -0300 Subject: [PATCH] fix: kill SIGINT signal at man for marked --help --- bin/main.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/bin/main.js b/bin/main.js index 76051eb626..b20689b305 100644 --- a/bin/main.js +++ b/bin/main.js @@ -35,10 +35,14 @@ 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); }); }