From 19b1a217cd6a0b30ca0509101f05cf0569d4ffb7 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Thu, 17 Feb 2022 13:01:53 -0800 Subject: [PATCH] Fix unit tests --- src/vs/workbench/contrib/terminal/browser/terminalInstance.ts | 2 +- .../contrib/terminal/browser/terminalProcessManager.ts | 4 ++-- src/vs/workbench/contrib/terminal/common/terminal.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts b/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts index 11cbbf3e240..d94f2ca47a3 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts @@ -441,7 +441,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance { this._xtermReadyPromise.then(async () => { // Wait for a period to allow a container to be ready await this._containerReadyBarrier.wait(); - if (this._configHelper.config.shellIntegration.enabled && !this.shellLaunchConfig.executable) { + if (this._configHelper.config.shellIntegration?.enabled && !this.shellLaunchConfig.executable) { const os = await this._processManager.getBackendOS(); this.shellLaunchConfig.executable = (await this._terminalProfileResolverService.getDefaultProfile({ remoteAuthority: this.remoteAuthority, os })).path; } diff --git a/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.ts b/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.ts index cbf26f79172..603ed03ea2a 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.ts @@ -243,7 +243,7 @@ export class TerminalProcessManager extends Disposable implements ITerminalProce os: this.os }); try { - const shellIntegration = terminalEnvironment.injectShellIntegrationArgs(this._logService, this._configurationService, env, this._configHelper.config.shellIntegration.enabled, shellLaunchConfig, this.os); + const shellIntegration = terminalEnvironment.injectShellIntegrationArgs(this._logService, this._configurationService, env, this._configHelper.config.shellIntegration?.enabled || false, shellLaunchConfig, this.os); this.shellIntegrationAttempted = shellIntegration.enableShellIntegration; if (this.shellIntegrationAttempted && shellIntegration.args) { const remoteEnv = await this._remoteAgentService.getEnvironment(); @@ -448,7 +448,7 @@ export class TerminalProcessManager extends Disposable implements ITerminalProce const env = await this._resolveEnvironment(backend, variableResolver, shellLaunchConfig); - const shellIntegration = terminalEnvironment.injectShellIntegrationArgs(this._logService, this._configurationService, env, this._configHelper.config.shellIntegration.enabled, shellLaunchConfig, OS); + const shellIntegration = terminalEnvironment.injectShellIntegrationArgs(this._logService, this._configurationService, env, this._configHelper.config.shellIntegration?.enabled || false, shellLaunchConfig, OS); if (shellIntegration.enableShellIntegration) { shellLaunchConfig.args = shellIntegration.args; // Always resolve the injected arguments on local processes diff --git a/src/vs/workbench/contrib/terminal/common/terminal.ts b/src/vs/workbench/contrib/terminal/common/terminal.ts index 70e546274ee..a12cccbc694 100644 --- a/src/vs/workbench/contrib/terminal/common/terminal.ts +++ b/src/vs/workbench/contrib/terminal/common/terminal.ts @@ -290,7 +290,7 @@ export interface ITerminalConfiguration { persistentSessionReviveProcess: 'onExit' | 'onExitAndWindowClose' | 'never'; ignoreProcessNames: string[]; autoReplies: { [key: string]: string }; - shellIntegration: { + shellIntegration?: { enabled: boolean; }; }