title: How to send control C node.js and child_processes
body: <p>Hello I want to send to the child_process, for example, ping 8.8.8.8-t, that is, an infinite number of ping. And some of the iterations I want to stop this command and execute a new, but in this case I do not want to kill a child process.</p>
  
  <p>Example:</p>
  
  <pre><code>var spawn = require('child_process').spawn('cmd'),
      iconv = require('iconv-lite');
  
  spawn.stdout.on('data', function (data) {
      console.log('Stdout: ', iconv.decode(data, 'cp866'));
  });
  
  spawn.stderr.on('data', function (data) {
      console.log('Stderr: ', iconv.decode(data, 'cp866'));
  });
  
  spawn.stdin.write('ping 8.8.8.8 -t'+ '\r\n');
  
  spawn.stdin.write(here control-c...); // WRONG
  
  spawn.stdin.write('dir' + '\r\n');
  </code></pre>