This commit is contained in:
meganrogge
2022-02-22 12:19:09 -06:00
parent 08b18a259a
commit ee416bb9b8
2 changed files with 6 additions and 1 deletions
@@ -456,12 +456,15 @@ export class TerminalProcessManager extends Disposable implements ITerminalProce
if (shellIntegration.enableShellIntegration) {
shellLaunchConfig.args = shellIntegration.args;
if (env?.['ZDOTDIR']) {
shellLaunchConfig.env = shellLaunchConfig.env || {} as IProcessEnvironment;
const activeWorkspaceRootUri = this._historyService.getLastActiveWorkspaceRoot(Schemas.file);
const lastActiveWorkspaceRoot = activeWorkspaceRootUri ? withNullAsUndefined(this._workspaceContextService.getWorkspaceFolder(activeWorkspaceRootUri)) : undefined;
const resolved = await this._configurationResolverService.resolveAsync(lastActiveWorkspaceRoot, env['ZDOTDIR']);
env['ZDOTDIR'] = resolved;
}
if (env?.['VSCODE_SHELL_LOGIN'] && shellLaunchConfig.env?.['VSCODE_SHELL_LOGIN']) {
this._logService.info('vscode shell login');
shellLaunchConfig.env['VSCODE_SHELL_LOGIN'] = env?.['VSCODE_SHELL_LOGIN'];
}
// Always resolve the injected arguments on local processes
await this._terminalProfileResolverService.resolveShellLaunchConfig(shellLaunchConfig, {
remoteAuthority: undefined,
@@ -150,6 +150,8 @@ class LocalTerminalBackend extends BaseTerminalBackend implements ITerminalBacke
shouldPersist: boolean
): Promise<ITerminalChildProcess> {
const executableEnv = await this._shellEnvironmentService.getShellEnv();
executableEnv['VSCODE_SHELL_LOGIN'] = env['VSCODE_SHELL_LOGIN'];
executableEnv['ZDOTDIR'] = env['ZDOTDIR'];
const id = await this._localPtyService.createProcess(shellLaunchConfig, cwd, cols, rows, unicodeVersion, env, executableEnv, windowsEnableConpty, shouldPersist, this._getWorkspaceId(), this._getWorkspaceName());
const pty = this._instantiationService.createInstance(LocalPty, id, shouldPersist);
this._ptys.set(id, pty);