This commit is contained in:
João Moreno
2019-09-11 13:31:42 +02:00
committed by GitHub
parent d4f1c39dc0
commit ab10e26096
6 changed files with 13 additions and 7 deletions

View File

@@ -4,7 +4,6 @@
*--------------------------------------------------------------------------------------------*/
import { spawn, ChildProcess, SpawnOptions } from 'child_process';
import { assign } from 'vs/base/common/objects';
import { buildHelpMessage, buildVersionMessage, addArg, createWaitMarkerFile, OPTIONS } from 'vs/platform/environment/node/argv';
import { parseCLIProcessArgv } from 'vs/platform/environment/node/argvHelper';
import { ParsedArgs } from 'vs/platform/environment/common/environment';
@@ -118,10 +117,15 @@ export async function main(argv: string[]): Promise<any> {
// Just Code
else {
const env = assign({}, process.env, {
const env: NodeJS.ProcessEnv = {
...process.env,
'VSCODE_CLI': '1', // this will signal Code that it was spawned from this module
'ELECTRON_NO_ATTACH_CONSOLE': '1'
});
};
if (args['force-user-env']) {
env['VSCODE_FORCE_USER_ENV'] = '1';
}
delete env['ELECTRON_RUN_AS_NODE'];

View File

@@ -98,7 +98,7 @@ export function getShellEnvironment(logService: ILogService, environmentService:
} else if (isWindows) {
logService.trace('getShellEnvironment: running on Windows, skipping');
_shellEnv = Promise.resolve({});
} else if (process.env['VSCODE_CLI'] === '1') {
} else if (process.env['VSCODE_CLI'] === '1' && process.env['VSCODE_FORCE_USER_ENV'] !== '1') {
logService.trace('getShellEnvironment: running on CLI, skipping');
_shellEnv = Promise.resolve({});
} else {