提交 d62c642e 编写于 作者: D Daniel Imms

Don't use environment collections when using strictEnv

Fixes #96630
上级 40cd17de
...@@ -198,8 +198,10 @@ export class ExtHostTerminalService extends BaseExtHostTerminalService { ...@@ -198,8 +198,10 @@ export class ExtHostTerminalService extends BaseExtHostTerminalService {
); );
// Apply extension environment variable collections to the environment // Apply extension environment variable collections to the environment
const mergedCollection = new MergedEnvironmentVariableCollection(this._environmentVariableCollections); if (!shellLaunchConfig.strictEnv) {
mergedCollection.applyToProcessEnvironment(env); const mergedCollection = new MergedEnvironmentVariableCollection(this._environmentVariableCollections);
mergedCollection.applyToProcessEnvironment(env);
}
this._proxy.$sendResolvedLaunchConfig(id, shellLaunchConfig); this._proxy.$sendResolvedLaunchConfig(id, shellLaunchConfig);
// Fork the process and listen for messages // Fork the process and listen for messages
......
...@@ -245,12 +245,14 @@ export class TerminalProcessManager extends Disposable implements ITerminalProce ...@@ -245,12 +245,14 @@ export class TerminalProcessManager extends Disposable implements ITerminalProce
const env = terminalEnvironment.createTerminalEnvironment(shellLaunchConfig, lastActiveWorkspace, envFromConfigValue, this._configurationResolverService, isWorkspaceShellAllowed, this._productService.version, this._configHelper.config.detectLocale, baseEnv); const env = terminalEnvironment.createTerminalEnvironment(shellLaunchConfig, lastActiveWorkspace, envFromConfigValue, this._configurationResolverService, isWorkspaceShellAllowed, this._productService.version, this._configHelper.config.detectLocale, baseEnv);
// Fetch any extension environment additions and apply them // Fetch any extension environment additions and apply them
this._extEnvironmentVariableCollection = this._environmentVariableService.mergedCollection; if (!shellLaunchConfig.strictEnv) {
this._register(this._environmentVariableService.onDidChangeCollections(newCollection => this._onEnvironmentVariableCollectionChange(newCollection))); this._extEnvironmentVariableCollection = this._environmentVariableService.mergedCollection;
this._extEnvironmentVariableCollection.applyToProcessEnvironment(env); this._register(this._environmentVariableService.onDidChangeCollections(newCollection => this._onEnvironmentVariableCollectionChange(newCollection)));
if (this._extEnvironmentVariableCollection.map.size > 0) { this._extEnvironmentVariableCollection.applyToProcessEnvironment(env);
this._environmentVariableInfo = new EnvironmentVariableInfoChangesActive(this._extEnvironmentVariableCollection); if (this._extEnvironmentVariableCollection.map.size > 0) {
this._onEnvironmentVariableInfoChange.fire(this._environmentVariableInfo); this._environmentVariableInfo = new EnvironmentVariableInfoChangesActive(this._extEnvironmentVariableCollection);
this._onEnvironmentVariableInfoChange.fire(this._environmentVariableInfo);
}
} }
const useConpty = this._configHelper.config.windowsEnableConpty && !isScreenReaderModeEnabled; const useConpty = this._configHelper.config.windowsEnableConpty && !isScreenReaderModeEnabled;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册