@@ -12,7 +12,6 @@ import * as paths from 'vs/base/common/paths';
1212import * as strings from 'vs/base/common/strings' ;
1313import * as objects from 'vs/base/common/objects' ;
1414import * as platform from 'vs/base/common/platform' ;
15- import * as stdfork from 'vs/base/node/stdFork' ;
1615import { Emitter , Event } from 'vs/base/common/event' ;
1716import { TPromise } from 'vs/base/common/winjs.base' ;
1817import { 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