diff --git a/src/vs/code/node/cliProcessMain.ts b/src/vs/code/node/cliProcessMain.ts index d60299f35dd..5004d9c8d6e 100644 --- a/src/vs/code/node/cliProcessMain.ts +++ b/src/vs/code/node/cliProcessMain.ts @@ -10,6 +10,7 @@ import * as path from 'path'; import { parseArgs, ParsedArgs } from 'vs/code/node/argv'; import { TPromise } from 'vs/base/common/winjs.base'; import { sequence } from 'vs/base/common/async'; +import * as objects from 'vs/base/common/objects'; import { IPager } from 'vs/base/common/paging'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; @@ -145,7 +146,7 @@ const eventPrefix = 'monacoworkbench'; export function main(argv: ParsedArgs): TPromise { const services = new ServiceCollection(); - services.set(IEnvironmentService, new SyncDescriptor(EnvironmentService, parseArgs(process.argv))); + services.set(IEnvironmentService, new SyncDescriptor(EnvironmentService, objects.assign(parseArgs(process.argv), { execPath: process.execPath }))); const instantiationService: IInstantiationService = new InstantiationService(services); diff --git a/src/vs/code/node/sharedProcessMain.ts b/src/vs/code/node/sharedProcessMain.ts index 7efa3076c2f..e1f9e6c6950 100644 --- a/src/vs/code/node/sharedProcessMain.ts +++ b/src/vs/code/node/sharedProcessMain.ts @@ -6,6 +6,7 @@ import * as fs from 'fs'; import * as platform from 'vs/base/common/platform'; import product from 'vs/platform/product'; +import * as objects from 'vs/base/common/objects'; import pkg from 'vs/platform/package'; import { serve, Server, connect } from 'vs/base/parts/ipc/node/ipc.net'; import { TPromise } from 'vs/base/common/winjs.base'; @@ -58,7 +59,7 @@ function main(server: Server): void { const services = new ServiceCollection(); services.set(IEventService, new SyncDescriptor(EventService)); - services.set(IEnvironmentService, new SyncDescriptor(EnvironmentService, parseArgs(process.argv))); + services.set(IEnvironmentService, new SyncDescriptor(EnvironmentService, objects.assign(parseArgs(process.argv), { execPath: process.execPath }))); services.set(IConfigurationService, new SyncDescriptor(NodeConfigurationService)); services.set(IRequestService, new SyncDescriptor(RequestService)); diff --git a/src/vs/platform/environment/node/environmentService.ts b/src/vs/platform/environment/node/environmentService.ts index 9e5c098e1ba..8e46db9c60b 100644 --- a/src/vs/platform/environment/node/environmentService.ts +++ b/src/vs/platform/environment/node/environmentService.ts @@ -11,6 +11,8 @@ import * as path from 'path'; import {ParsedArgs} from 'vs/code/node/argv'; import URI from 'vs/base/common/uri'; +// TODO@Ben TODO@Joao this interface should be composed once the main => renderer +// communication is also fit for that export interface IEnvironment extends ParsedArgs { execPath: string; }