Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Readline: spawning child process with inherit on windows breaks SIGINT handling #5634

Open
mdlawson opened this Issue · 0 comments

1 participant

@mdlawson

When spawning a process like so:

child = spawn("ls",[], {stdio: "inherit"})

in windows, while a readline terminal is in use, after the child process has exited, readline no longer catches ctrl-C as SIGINT, ctrl-C simply exits node.

Can be reproduced in nodejs 0.10.10 with the following code

var readline = require("readline");

var spawn = require("child_process").spawn;

rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
});

rl.on("line", function(line) {
  var child = spawn("cp", [], {
    stdio: "inherit"
  });
  child.on("exit", function() {
    rl.prompt();
  });
});

rl.on('SIGINT', function() {
  console.log("SIGINT");
  rl.prompt();
});

rl.prompt();

After pressing enter once to run cp, ctrl-c no longer functions as expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.