3

I have created a child process that I am trying to kill by process id.

const { spawn } = require('child_process');
let child = spawn("powershell.exe", 'file1.ps1', { detached: false });
process.kill(child.pid, 'SIGINT');

The use of standard POSIX signals like SIGINT or SIGKILL can kill the child process but causes 'Extension host terminated unexpectedly' error. After this none of the registered commands works for that extension. It produce "Command 'extension.commandName' not found" error.

Note: All the registered command is pushed in context.subscriptions and deactivate() method is also in place. I am trying it against Windows.

Shahriar Hossain
  • 935
  • 9
  • 20

0 Answers0