diff --git a/src/vs/workbench/api/node/extHost.api.impl.ts b/src/vs/workbench/api/node/extHost.api.impl.ts index 31e31018b5e..eea4190baed 100644 --- a/src/vs/workbench/api/node/extHost.api.impl.ts +++ b/src/vs/workbench/api/node/extHost.api.impl.ts @@ -118,7 +118,7 @@ export function createApiFactory( const extHostFileSystem = rpcProtocol.set(ExtHostContext.ExtHostFileSystem, new ExtHostFileSystem(rpcProtocol, extHostLanguageFeatures)); const extHostFileSystemEvent = rpcProtocol.set(ExtHostContext.ExtHostFileSystemEventService, new ExtHostFileSystemEventService(rpcProtocol, extHostDocumentsAndEditors)); const extHostQuickOpen = rpcProtocol.set(ExtHostContext.ExtHostQuickOpen, new ExtHostQuickOpen(rpcProtocol, extHostWorkspace, extHostCommands)); - const extHostTerminalService = rpcProtocol.set(ExtHostContext.ExtHostTerminalService, new ExtHostTerminalService(rpcProtocol, extHostConfiguration)); + const extHostTerminalService = rpcProtocol.set(ExtHostContext.ExtHostTerminalService, new ExtHostTerminalService(rpcProtocol, extHostConfiguration, extHostLogService)); const extHostDebugService = rpcProtocol.set(ExtHostContext.ExtHostDebugService, new ExtHostDebugService(rpcProtocol, extHostWorkspace, extensionService, extHostDocumentsAndEditors, extHostConfiguration, extHostTerminalService)); const extHostSCM = rpcProtocol.set(ExtHostContext.ExtHostSCM, new ExtHostSCM(rpcProtocol, extHostCommands, extHostLogService)); const extHostSearch = rpcProtocol.set(ExtHostContext.ExtHostSearch, new ExtHostSearch(rpcProtocol, schemeTransformer)); diff --git a/src/vs/workbench/api/node/extHostTerminalService.ts b/src/vs/workbench/api/node/extHostTerminalService.ts index 4d93e8aed49..b6de962d48c 100644 --- a/src/vs/workbench/api/node/extHostTerminalService.ts +++ b/src/vs/workbench/api/node/extHostTerminalService.ts @@ -7,12 +7,11 @@ import * as vscode from 'vscode'; import * as os from 'os'; import * as platform from 'vs/base/common/platform'; -// import * as terminalEnvironment from 'vs/workbench/parts/terminal/node/terminalEnvironment'; -// import Uri from 'vs/base/common/uri'; +import * as terminalEnvironment from 'vs/workbench/parts/terminal/node/terminalEnvironment'; import { Event, Emitter } from 'vs/base/common/event'; import { ExtHostTerminalServiceShape, MainContext, MainThreadTerminalServiceShape, IMainContext, ShellLaunchConfigDto } from 'vs/workbench/api/node/extHost.protocol'; import { ExtHostConfiguration } from 'vs/workbench/api/node/extHostConfiguration'; -// import { ILogService } from 'vs/platform/log/common/log'; +import { ILogService } from 'vs/platform/log/common/log'; import { EXT_HOST_CREATION_DELAY } from 'vs/workbench/parts/terminal/common/terminal'; import { TerminalProcess } from 'vs/workbench/parts/terminal/node/terminalProcess'; @@ -241,7 +240,7 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape { constructor( mainContext: IMainContext, private _extHostConfiguration: ExtHostConfiguration, - // private _logService: ILogService + private _logService: ILogService ) { this._proxy = mainContext.getProxy(MainContext.MainThreadTerminalService); } @@ -358,8 +357,6 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape { const terminalConfig = this._extHostConfiguration.getConfiguration('terminal.integrated'); - // TODO: Move locale into TerminalProcess - // const locale = terminalConfig.get('setLocaleVariables') ? platform.locale : undefined; if (!shellLaunchConfig.executable) { // TODO: This duplicates some of TerminalConfigHelper.mergeDefaultShellPathAndArgs and should be merged // this._configHelper.mergeDefaultShellPathAndArgs(shellLaunchConfig); @@ -383,20 +380,20 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape { // const platformKey = platform.isWindows ? 'windows' : (platform.isMacintosh ? 'osx' : 'linux'); // const envFromConfig = terminalEnvironment.resolveConfigurationVariables(this._configurationResolverService, { ...this._configHelper.config.env[platformKey] }, lastActiveWorkspaceRoot); // const envFromShell = terminalEnvironment.resolveConfigurationVariables(this._configurationResolverService, { ...shellLaunchConfig.env }, lastActiveWorkspaceRoot); - // shellLaunchConfig.env = envFromShell; // Merge process env with the env from config - // const parentEnv = { ...process.env }; - // terminalEnvironment.mergeEnvironments(parentEnv, envFromConfig); + const env = { ...process.env }; + // terminalEnvironment.mergeEnvironments(env, envFromConfig); + terminalEnvironment.mergeEnvironments(env, shellLaunchConfig.env); // Continue env initialization, merging in the env from the launch // config and adding keys that are needed to create the process - // const env = terminalEnvironment.createTerminalEnv(parentEnv, shellLaunchConfig, initialCwd, locale, cols, rows); - // const options = { env, cwd, execArgv: [] }; + const locale = terminalConfig.get('setLocaleVariables') ? platform.locale : undefined; + terminalEnvironment.addTerminalEnvironmentKeys(env, locale); // Fork the process and listen for messages - // this._logService.debug(`Terminal process launching on ext host`, options); - this._terminalProcesses[id] = new TerminalProcess(shellLaunchConfig, initialCwd, cols, rows); + this._logService.debug(`Terminal process launching on ext host`, shellLaunchConfig, initialCwd, cols, rows, env); + this._terminalProcesses[id] = new TerminalProcess(shellLaunchConfig, initialCwd, cols, rows, env); this._terminalProcesses[id].onProcessIdReady(pid => this._proxy.$sendProcessPid(id, pid)); this._terminalProcesses[id].onProcessTitleChanged(title => this._proxy.$sendProcessTitle(id, title)); this._terminalProcesses[id].onProcessData(data => this._proxy.$sendProcessData(id, data)); diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts index 5ef75ca86bc..e2729910d65 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts @@ -3,19 +3,20 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import * as platform from 'vs/base/common/platform'; import * as terminalEnvironment from 'vs/workbench/parts/terminal/node/terminalEnvironment'; import { IDisposable } from 'vs/base/common/lifecycle'; import { ProcessState, ITerminalProcessManager, IShellLaunchConfig, ITerminalConfigHelper } from 'vs/workbench/parts/terminal/common/terminal'; import { TPromise } from 'vs/base/common/winjs.base'; import { ILogService } from 'vs/platform/log/common/log'; import { Emitter, Event } from 'vs/base/common/event'; -import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver'; -import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IHistoryService } from 'vs/workbench/services/history/common/history'; import { ITerminalChildProcess } from 'vs/workbench/parts/terminal/node/terminal'; import { TerminalProcessExtHostProxy } from 'vs/workbench/parts/terminal/node/terminalProcessExtHostProxy'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { TerminalProcess } from 'vs/workbench/parts/terminal/node/terminalProcess'; +import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; +import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver'; /** The amount of time to consider terminal errors to be related to the launch */ const LAUNCHING_DURATION = 500; @@ -48,11 +49,13 @@ export class TerminalProcessManager implements ITerminalProcessManager { public get onProcessExit(): Event { return this._onProcessExit.event; } constructor( - private _terminalId: number, - private _configHelper: ITerminalConfigHelper, + private readonly _terminalId: number, + private readonly _configHelper: ITerminalConfigHelper, @IHistoryService private readonly _historyService: IHistoryService, @IInstantiationService private readonly _instantiationService: IInstantiationService, - @ILogService private _logService: ILogService + @ILogService private readonly _logService: ILogService, + @IWorkspaceContextService private readonly _workspaceContextService: IWorkspaceContextService, + @IConfigurationResolverService private readonly _configurationResolverService: IConfigurationResolverService ) { this.ptyProcessReady = new TPromise(c => { this.onProcessReady(() => { @@ -91,11 +94,35 @@ export class TerminalProcessManager implements ITerminalProcessManager { if (extensionHostOwned) { this._process = this._instantiationService.createInstance(TerminalProcessExtHostProxy, this._terminalId, shellLaunchConfig, cols, rows); } else { + if (!shellLaunchConfig.executable) { + this._configHelper.mergeDefaultShellPathAndArgs(shellLaunchConfig); + } + const lastActiveWorkspaceRootUri = this._historyService.getLastActiveWorkspaceRoot('file'); this.initialCwd = terminalEnvironment.getCwd(shellLaunchConfig, lastActiveWorkspaceRootUri, this._configHelper); - this._logService.debug(`Terminal process launching`, shellLaunchConfig, this.initialCwd, cols, rows); - this._process = this._instantiationService.createInstance(TerminalProcess, shellLaunchConfig, this.initialCwd, cols, rows, lastActiveWorkspaceRootUri, this._configHelper); + // Resolve env vars from config and shell + const lastActiveWorkspaceRoot = this._workspaceContextService.getWorkspaceFolder(lastActiveWorkspaceRootUri); + const platformKey = platform.isWindows ? 'windows' : (platform.isMacintosh ? 'osx' : 'linux'); + const envFromConfig = terminalEnvironment.resolveConfigurationVariables(this._configurationResolverService, { ...this._configHelper.config.env[platformKey] }, lastActiveWorkspaceRoot); + const envFromShell = terminalEnvironment.resolveConfigurationVariables(this._configurationResolverService, { ...shellLaunchConfig.env }, lastActiveWorkspaceRoot); + shellLaunchConfig.env = envFromShell; + + // Merge process env with the env from config and from shellLaunchConfig + const env = { ...process.env }; + terminalEnvironment.mergeEnvironments(env, envFromConfig); + terminalEnvironment.mergeEnvironments(env, shellLaunchConfig.env); + + // Sanitize the environment, removing any undesirable VS Code and Electron environment + // variables + terminalEnvironment.sanitizeEnvironment(env); + + // Adding other env keys necessary to create the process + const locale = this._configHelper.config.setLocaleVariables ? platform.locale : undefined; + terminalEnvironment.addTerminalEnvironmentKeys(env, locale); + + this._logService.debug(`Terminal process launching`, shellLaunchConfig, this.initialCwd, cols, rows, env); + this._process = new TerminalProcess(shellLaunchConfig, this.initialCwd, cols, rows, env); } this.processState = ProcessState.LAUNCHING; diff --git a/src/vs/workbench/parts/terminal/node/terminalEnvironment.ts b/src/vs/workbench/parts/terminal/node/terminalEnvironment.ts index d2780d3a178..84c4aa560c4 100644 --- a/src/vs/workbench/parts/terminal/node/terminalEnvironment.ts +++ b/src/vs/workbench/parts/terminal/node/terminalEnvironment.ts @@ -8,7 +8,6 @@ import * as paths from 'vs/base/common/paths'; import * as platform from 'vs/base/common/platform'; import pkg from 'vs/platform/node/package'; import Uri from 'vs/base/common/uri'; -import { IStringDictionary } from 'vs/base/common/collections'; import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; import { IShellLaunchConfig, ITerminalConfigHelper } from 'vs/workbench/parts/terminal/common/terminal'; import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver'; @@ -17,7 +16,7 @@ import { IConfigurationResolverService } from 'vs/workbench/services/configurati * This module contains utility functions related to the environment, cwd and paths. */ -export function mergeEnvironments(parent: IStringDictionary, other: IStringDictionary) { +export function mergeEnvironments(parent: platform.IProcessEnvironment, other: platform.IProcessEnvironment): void { if (!other) { return; } @@ -44,7 +43,7 @@ export function mergeEnvironments(parent: IStringDictionary, other: IStr } } -function _mergeEnvironmentValue(env: IStringDictionary, key: string, value: string | null) { +function _mergeEnvironmentValue(env: platform.IProcessEnvironment, key: string, value: string | null): void { if (typeof value === 'string') { env[key] = value; } else { @@ -52,20 +51,44 @@ function _mergeEnvironmentValue(env: IStringDictionary, key: string, val } } -export function createTerminalEnv(shell: IShellLaunchConfig, locale: string): IStringDictionary { - const env = { ...process.env }; - if (shell.env) { - mergeEnvironments(env, shell.env); - } +export function sanitizeEnvironment(env: platform.IProcessEnvironment): void { + // Remove keys based on strings + const keysToRemove = [ + 'ELECTRON_ENABLE_STACK_DUMPING', + 'ELECTRON_ENABLE_LOGGING', + 'ELECTRON_NO_ASAR', + 'ELECTRON_NO_ATTACH_CONSOLE', + 'ELECTRON_RUN_AS_NODE', + 'GOOGLE_API_KEY', + 'VSCODE_CLI', + 'VSCODE_DEV', + 'VSCODE_IPC_HOOK', + 'VSCODE_LOGS', + 'VSCODE_NLS_CONFIG', + 'VSCODE_PORTABLE', + 'VSCODE_PID', + ]; + keysToRemove.forEach((key) => { + if (env[key]) { + delete env[key]; + } + }); + // Remove keys based on regexp + Object.keys(env).forEach(key => { + if (key.search(/^VSCODE_NODE_CACHED_DATA_DIR_\d+$/) === 0) { + delete env[key]; + } + }); +} + +export function addTerminalEnvironmentKeys(env: platform.IProcessEnvironment, locale: string | undefined): void { env['TERM_PROGRAM'] = 'vscode'; env['TERM_PROGRAM_VERSION'] = pkg.version; env['LANG'] = _getLangEnvVariable(locale); - - return env; } -export function resolveConfigurationVariables(configurationResolverService: IConfigurationResolverService, env: IStringDictionary, lastActiveWorkspaceRoot: IWorkspaceFolder): IStringDictionary { +export function resolveConfigurationVariables(configurationResolverService: IConfigurationResolverService, env: platform.IProcessEnvironment, lastActiveWorkspaceRoot: IWorkspaceFolder): platform.IProcessEnvironment { Object.keys(env).forEach((key) => { if (typeof env[key] === 'string') { env[key] = configurationResolverService.resolve(lastActiveWorkspaceRoot, env[key]); diff --git a/src/vs/workbench/parts/terminal/node/terminalProcess.ts b/src/vs/workbench/parts/terminal/node/terminalProcess.ts index 6966f93405b..599a1f3156c 100644 --- a/src/vs/workbench/parts/terminal/node/terminalProcess.ts +++ b/src/vs/workbench/parts/terminal/node/terminalProcess.ts @@ -7,14 +7,10 @@ import * as os from 'os'; import * as path from 'path'; import * as platform from 'vs/base/common/platform'; import * as pty from 'node-pty'; -import * as terminalEnvironment from 'vs/workbench/parts/terminal/node/terminalEnvironment'; import { Event, Emitter } from 'vs/base/common/event'; import { ITerminalChildProcess } from 'vs/workbench/parts/terminal/node/terminal'; import { IDisposable } from 'vs/base/common/lifecycle'; -import { IShellLaunchConfig, ITerminalConfigHelper } from 'vs/workbench/parts/terminal/common/terminal'; -import { IWorkspaceContextService, IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; -import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver'; -import URI from 'vs/base/common/uri'; +import { IShellLaunchConfig } from 'vs/workbench/parts/terminal/common/terminal'; export class TerminalProcess implements ITerminalChildProcess, IDisposable { private _exitCode: number; @@ -32,14 +28,11 @@ export class TerminalProcess implements ITerminalChildProcess, IDisposable { public get onProcessTitleChanged(): Event { return this._onProcessTitleChanged.event; } constructor( - @IWorkspaceContextService private readonly _workspaceContextService: IWorkspaceContextService, - @IConfigurationResolverService private readonly _configurationResolverService: IConfigurationResolverService, shellLaunchConfig: IShellLaunchConfig, cwd: string, cols: number, rows: number, - lastActiveWorkspaceRootUri: URI, - private readonly _configHelper: ITerminalConfigHelper + env: platform.IProcessEnvironment ) { // The pty process needs to be run in its own child process to get around maxing out CPU on Mac, // see https://github.com/electron/electron/issues/38 @@ -52,13 +45,6 @@ export class TerminalProcess implements ITerminalChildProcess, IDisposable { shellName = 'xterm-256color'; } - if (!shellLaunchConfig.executable) { - this._configHelper.mergeDefaultShellPathAndArgs(shellLaunchConfig); - } - - const lastActiveWorkspaceRoot = this._workspaceContextService.getWorkspaceFolder(lastActiveWorkspaceRootUri); - - const env = this._createEnv(shellLaunchConfig, lastActiveWorkspaceRoot); const options: pty.IPtyForkOptions = { name: shellName, cwd, @@ -94,58 +80,6 @@ export class TerminalProcess implements ITerminalChildProcess, IDisposable { this._onProcessTitleChanged.dispose(); } - private _createEnv(shellLaunchConfig: IShellLaunchConfig, lastActiveWorkspaceRoot: IWorkspaceFolder): platform.IProcessEnvironment { - // TODO: Move locale into TerminalProcess - const locale = this._configHelper.config.setLocaleVariables ? platform.locale : undefined; - // Resolve env vars from config and shell - const platformKey = platform.isWindows ? 'windows' : (platform.isMacintosh ? 'osx' : 'linux'); - const envFromConfig = terminalEnvironment.resolveConfigurationVariables(this._configurationResolverService, { ...this._configHelper.config.env[platformKey] }, lastActiveWorkspaceRoot); - const envFromShell = terminalEnvironment.resolveConfigurationVariables(this._configurationResolverService, { ...shellLaunchConfig.env }, lastActiveWorkspaceRoot); - shellLaunchConfig.env = envFromShell; - - const env: platform.IProcessEnvironment = { ...process.env }; - - // Merge process env with the env from config - // TODO: Move environment merge stuff into TerminalProcess - terminalEnvironment.mergeEnvironments(env, envFromConfig); - - // Continue env initialization, merging in the env from the launch - // config and adding keys that are needed to create the process - const env = terminalEnvironment.createTerminalEnv(shellLaunchConfig, locale); - - const keysToRemove = [ - 'ELECTRON_ENABLE_STACK_DUMPING', - 'ELECTRON_ENABLE_LOGGING', - 'ELECTRON_NO_ASAR', - 'ELECTRON_RUN_AS_NODE', - 'GOOGLE_API_KEY', - 'VSCODE_CLI', - 'VSCODE_DEV', - 'VSCODE_IPC_HOOK', - 'VSCODE_LOGS', - 'VSCODE_NLS_CONFIG', - 'VSCODE_PORTABLE', - 'VSCODE_PID', - ]; - keysToRemove.forEach((key) => { - if (env[key]) { - delete env[key]; - } - }); - Object.keys(env).forEach(key => { - if (key.search(/^VSCODE_NODE_CACHED_DATA_DIR_\d+$/) === 0) { - delete env[key]; - } - }); - // TODO: Determine which parts of env initialization should go where - // const envFromConfig = terminalEnvironment.resolveConfigurationVariables(this._configurationResolverService, { ...this._configHelper.config.env[platformKey] }, lastActiveWorkspaceRoot); - // const envFromShell = terminalEnvironment.resolveConfigurationVariables(this._configurationResolverService, { ...shellLaunchConfig.env }, lastActiveWorkspaceRoot); - // shellLaunchConfig.env = envFromShell; - // terminalEnvironment.mergeEnvironments(parentEnv, envFromConfig); - // const env = terminalEnvironment.createTerminalEnv(parentEnv, shellLaunchConfig, this.initialCwd, locale, cols, rows); - return env; - } - private _setupTitlePolling() { this._sendProcessTitle(); setInterval(() => { diff --git a/src/vs/workbench/parts/terminal/test/node/terminalEnvironment.test.ts b/src/vs/workbench/parts/terminal/test/node/terminalEnvironment.test.ts index 5fae93b3d01..b5223b0949e 100644 --- a/src/vs/workbench/parts/terminal/test/node/terminalEnvironment.test.ts +++ b/src/vs/workbench/parts/terminal/test/node/terminalEnvironment.test.ts @@ -9,46 +9,46 @@ import * as platform from 'vs/base/common/platform'; import * as terminalEnvironment from 'vs/workbench/parts/terminal/node/terminalEnvironment'; import Uri from 'vs/base/common/uri'; import { IStringDictionary } from 'vs/base/common/collections'; -import { IShellLaunchConfig, ITerminalConfigHelper } from 'vs/workbench/parts/terminal/common/terminal'; +import { /*IShellLaunchConfig,*/ ITerminalConfigHelper } from 'vs/workbench/parts/terminal/common/terminal'; suite('Workbench - TerminalEnvironment', () => { - test('createTerminalEnv', function () { - const shell1 = { - executable: '/bin/foosh', - args: ['-bar', 'baz'] - }; - const parentEnv1: IStringDictionary = { - ok: true - } as any; - const env1 = terminalEnvironment.createTerminalEnv(parentEnv1, shell1, '/foo', 'en-au'); - assert.ok(env1['ok'], 'Parent environment is copied'); - assert.deepStrictEqual(parentEnv1, { ok: true }, 'Parent environment is unchanged'); - assert.equal(env1['PTYPID'], process.pid.toString(), 'PTYPID is equal to the current PID'); - assert.equal(env1['PTYSHELL'], '/bin/foosh', 'PTYSHELL is equal to the provided shell'); - assert.equal(env1['PTYSHELLARG0'], '-bar', 'PTYSHELLARG0 is equal to the first shell argument'); - assert.equal(env1['PTYSHELLARG1'], 'baz', 'PTYSHELLARG1 is equal to the first shell argument'); - assert.ok(!('PTYSHELLARG2' in env1), 'PTYSHELLARG2 is unset'); - assert.equal(env1['PTYCWD'], '/foo', 'PTYCWD is equal to requested cwd'); - assert.equal(env1['LANG'], 'en_AU.UTF-8', 'LANG is equal to the requested locale with UTF-8'); + // test('createTerminalEnv', function () { + // const shell1 = { + // executable: '/bin/foosh', + // args: ['-bar', 'baz'] + // }; + // const parentEnv1: IStringDictionary = { + // ok: true + // } as any; + // const env1 = terminalEnvironment.createTerminalEnv(parentEnv1, shell1, '/foo', 'en-au'); + // assert.ok(env1['ok'], 'Parent environment is copied'); + // assert.deepStrictEqual(parentEnv1, { ok: true }, 'Parent environment is unchanged'); + // assert.equal(env1['PTYPID'], process.pid.toString(), 'PTYPID is equal to the current PID'); + // assert.equal(env1['PTYSHELL'], '/bin/foosh', 'PTYSHELL is equal to the provided shell'); + // assert.equal(env1['PTYSHELLARG0'], '-bar', 'PTYSHELLARG0 is equal to the first shell argument'); + // assert.equal(env1['PTYSHELLARG1'], 'baz', 'PTYSHELLARG1 is equal to the first shell argument'); + // assert.ok(!('PTYSHELLARG2' in env1), 'PTYSHELLARG2 is unset'); + // assert.equal(env1['PTYCWD'], '/foo', 'PTYCWD is equal to requested cwd'); + // assert.equal(env1['LANG'], 'en_AU.UTF-8', 'LANG is equal to the requested locale with UTF-8'); - const shell2: IShellLaunchConfig = { - executable: '/bin/foosh', - args: [] - }; - const parentEnv2: IStringDictionary = { - LANG: 'en_US.UTF-8' - }; - const env2 = terminalEnvironment.createTerminalEnv(parentEnv2, shell2, '/foo', 'en-au'); - assert.ok(!('PTYSHELLARG0' in env2), 'PTYSHELLARG0 is unset'); - assert.equal(env2['PTYCWD'], '/foo', 'PTYCWD is equal to /foo'); - assert.equal(env2['LANG'], 'en_AU.UTF-8', 'LANG is equal to the requested locale with UTF-8'); + // const shell2: IShellLaunchConfig = { + // executable: '/bin/foosh', + // args: [] + // }; + // const parentEnv2: IStringDictionary = { + // LANG: 'en_US.UTF-8' + // }; + // const env2 = terminalEnvironment.createTerminalEnv(parentEnv2, shell2, '/foo', 'en-au'); + // assert.ok(!('PTYSHELLARG0' in env2), 'PTYSHELLARG0 is unset'); + // assert.equal(env2['PTYCWD'], '/foo', 'PTYCWD is equal to /foo'); + // assert.equal(env2['LANG'], 'en_AU.UTF-8', 'LANG is equal to the requested locale with UTF-8'); - const env3 = terminalEnvironment.createTerminalEnv(parentEnv1, shell1, '/', null); - assert.equal(env3['LANG'], 'en_US.UTF-8', 'LANG is equal to en_US.UTF-8 as fallback.'); // More info on issue #14586 + // const env3 = terminalEnvironment.createTerminalEnv(parentEnv1, shell1, '/', null); + // assert.equal(env3['LANG'], 'en_US.UTF-8', 'LANG is equal to en_US.UTF-8 as fallback.'); // More info on issue #14586 - const env4 = terminalEnvironment.createTerminalEnv(parentEnv2, shell1, '/', null); - assert.equal(env4['LANG'], 'en_US.UTF-8', 'LANG is equal to the parent environment\'s LANG'); - }); + // const env4 = terminalEnvironment.createTerminalEnv(parentEnv2, shell1, '/', null); + // assert.equal(env4['LANG'], 'en_US.UTF-8', 'LANG is equal to the parent environment\'s LANG'); + // }); suite('mergeEnvironments', () => { test('should add keys', () => {