Skip to content

Commit b1fd3ea

Browse files
authored
fix: kill SIGINT signal at man for marked --help (#3483)
1 parent 9c8c82c commit b1fd3ea

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

bin/main.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,14 @@ export async function main(nodeProcess) {
3535
const helpText = await readFile(resolve(__dirname, '../man/marked.1.md'), 'utf8');
3636

3737
await new Promise(res => {
38-
spawn('man', [resolve(__dirname, '../man/marked.1')], options)
39-
.on('error', () => {
40-
console.log(helpText);
41-
})
38+
const manProcess = spawn('man', [resolve(__dirname, '../man/marked.1')], options);
39+
nodeProcess.on('SIGINT', () => {
40+
manProcess.kill('SIGINT');
41+
});
42+
43+
manProcess.on('error', () => {
44+
console.log(helpText);
45+
})
4246
.on('close', res);
4347
});
4448
}

0 commit comments

Comments
 (0)