Remove 'ELECTRON_RUN_AS_NODE' env var on fork

This commit is contained in:
Andre Weinand 2018-08-22 15:18:41 +02:00 committed by GitHub
parent 47d5f58297
commit 961ff68f9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -285,7 +285,8 @@ export class DebugAdapter extends StreamDebugAdapter {
if (this.adapterExecutable.command === 'node' && this.outputService) {
if (Array.isArray(this.adapterExecutable.args) && this.adapterExecutable.args.length > 0) {
const child = cp.fork(this.adapterExecutable.args[0], this.adapterExecutable.args.slice(1), {
stdio: ['pipe', 'pipe', 'pipe', 'ipc']
execArgv: [ '-e', 'delete process.env.ELECTRON_RUN_AS_NODE;require(process.argv[1])' ].concat(process.execArgv || []),
silent: true
});
if (!child.pid) {
e(new Error(nls.localize('unableToLaunchDebugAdapter', "Unable to launch debug adapter from '{0}'.", this.adapterExecutable.args[0])));