Skip to content

Commit 344d24c

Browse files
committed
Prevents exiting the process on sigint through yarn-path (#7957)
1 parent 095a8b6 commit 344d24c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/cli/index.js

+5
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,11 @@ async function start(): Promise<void> {
629629
const opts = {stdio: 'inherit', env: Object.assign({}, process.env, {YARN_IGNORE_PATH: 1})};
630630
let exitCode = 0;
631631

632+
process.on(`SIGINT`, () => {
633+
// We don't want SIGINT to kill our process; we want it to kill the
634+
// innermost process, whose end will cause our own to exit.
635+
});
636+
632637
try {
633638
if (yarnPath.endsWith(`.js`)) {
634639
exitCode = await spawnp(process.execPath, [yarnPath, ...argv], opts);

0 commit comments

Comments
 (0)