diff --git a/src/cli/index.js b/src/cli/index.js index 5a66fc03a4..c449d7758a 100644 --- a/src/cli/index.js +++ b/src/cli/index.js @@ -629,6 +629,11 @@ async function start(): Promise { const opts = {stdio: 'inherit', env: Object.assign({}, process.env, {YARN_IGNORE_PATH: 1})}; let exitCode = 0; + process.on(`SIGINT`, () => { + // We don't want SIGINT to kill our process; we want it to kill the + // innermost process, whose end will cause our own to exit. + }); + try { if (yarnPath.endsWith(`.js`)) { exitCode = await spawnp(process.execPath, [yarnPath, ...argv], opts);