Skip to content

Commit f2c62ea

Browse files
authored
Merge pull request microsoft#56917 from Microsoft/isidorn/removeStdfork
debug remove stdFork usage
2 parents e0195d7 + ce5e9e8 commit f2c62ea

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

src/vs/workbench/parts/debug/node/debugAdapter.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import * as paths from 'vs/base/common/paths';
1212
import * as strings from 'vs/base/common/strings';
1313
import * as objects from 'vs/base/common/objects';
1414
import * as platform from 'vs/base/common/platform';
15-
import * as stdfork from 'vs/base/node/stdFork';
1615
import { Emitter, Event } from 'vs/base/common/event';
1716
import { TPromise } from 'vs/base/common/winjs.base';
1817
import { ExtensionsChannelId } from 'vs/platform/extensionManagement/common/extensionManagement';
@@ -285,13 +284,15 @@ export class DebugAdapter extends StreamDebugAdapter {
285284

286285
if (this.adapterExecutable.command === 'node' && this.outputService) {
287286
if (Array.isArray(this.adapterExecutable.args) && this.adapterExecutable.args.length > 0) {
288-
stdfork.fork(this.adapterExecutable.args[0], this.adapterExecutable.args.slice(1), {}, (err, child) => {
289-
if (err) {
290-
e(new Error(nls.localize('unableToLaunchDebugAdapter', "Unable to launch debug adapter from '{0}'.", this.adapterExecutable.args[0])));
291-
}
292-
this.serverProcess = child;
293-
c(null);
287+
const child = cp.fork(this.adapterExecutable.args[0], this.adapterExecutable.args.slice(1), {
288+
execArgv: ['-e', 'delete process.env.ELECTRON_RUN_AS_NODE;require(process.argv[1])'].concat(process.execArgv || []),
289+
silent: true
294290
});
291+
if (!child.pid) {
292+
e(new Error(nls.localize('unableToLaunchDebugAdapter', "Unable to launch debug adapter from '{0}'.", this.adapterExecutable.args[0])));
293+
}
294+
this.serverProcess = child;
295+
c(null);
295296
} else {
296297
e(new Error(nls.localize('unableToLaunchDebugAdapterNoArgs', "Unable to launch debug adapter.")));
297298
}

0 commit comments

Comments
 (0)