I tried to spawn child process - vvp (https://linux.die.net/man/1/vvp). At the certain time, I need to send CTRL+C to that process. I am expecting that simulation will be interrupted and I get the interactive prompt. And after that I can continue the simulation by send command to the child process. So, I tried something like this:
var child = require('child_process');
var fs = require('fs');
var vcdGen = child.spawn('vvp', ['qqq'], {});
vcdGen.stdout.on('data', function(data) {
console.log(data.toString())
});
setTimeout(function() {
vcdGen.kill('SIGINT');
}, 400);
In that case, a child process was stopped.
I also tried vcdGen.stdin.write('\x03')
instead of vcdGen.kill('SIGINT');
but it isn't work.
Maybe it's because of Windows? Is there any way to achieve the same behaviour as I got in cmd?