src/vs/base/node/processes.ts/terminateProcess
function terminateProcess(process: cp.ChildProcess, cwd?: string): Promise<TerminateResponse> {
	if (Platform.isWindows) {
		try {
			const options: any = {
				stdio: ['pipe', 'pipe', 'ignore']
			};
			if (cwd) {
				options.cwd = cwd;
			}
			const killProcess = cp.execFile('taskkill', ['/T', '/F', '/PID', process.pid.toString()], options);
			return new Promise(resolve => {
				killProcess.once('error', (err) => {
					resolve({ success: false, error: err });
				});
				killProcess.once('exit', (code, signal) => {
					if (code === 0) {
						resolve({ success: true });
					} else {
						resolve({ success: false, code: code !== null ? code : TerminateResponseCode.Unknown });
					}
				});
			});
		} catch (err) {
			return Promise.resolve({ success: false, error: err, code: err.status ? getWindowsCode(err.status) : TerminateResponseCode.Unknown });
		}
	} else if (Platform.isLinux || Platform.isMacintosh) {
		try {
			const cmd = FileAccess.asFileUri('vs/base/node/terminateProcess.sh', require).fsPath;
			return new Promise(resolve => {
				cp.execFile(cmd, [process.pid.toString()], { encoding: 'utf8', shell: true } as cp.ExecFileOptions, (err, stdout, stderr) => {
					if (err) {
						resolve({ success: false, error: err });
					} else {
						resolve({ success: true });
					}
				});
			});
		} catch (err) {
			return Promise.resolve({ success: false, error: err });
		}
	} else {
		process.kill('SIGKILL');
	}
	return Promise.resolve({ success: true });
}