diff --git a/src/client/terminals/envCollectionActivation/service.ts b/src/client/terminals/envCollectionActivation/service.ts index 68c098c4c928..b9a9fc17b3d5 100644 --- a/src/client/terminals/envCollectionActivation/service.ts +++ b/src/client/terminals/envCollectionActivation/service.ts @@ -243,7 +243,9 @@ export class TerminalEnvVarCollectionService implements IExtensionActivationServ envVarCollection.description = description; await this.trackTerminalPrompt(shell, resource, env); - await this.terminalDeactivateService.initializeScriptParams(shell); + await this.terminalDeactivateService.initializeScriptParams(shell).catch((ex) => { + traceError(`Failed to initialize deactivate script`, shell, ex); + }); } private isPromptSet = new Map(); diff --git a/src/test/interpreters/activation/terminalEnvVarCollectionService.unit.test.ts b/src/test/interpreters/activation/terminalEnvVarCollectionService.unit.test.ts index 55e0b80d3e1e..daf3150fdbd0 100644 --- a/src/test/interpreters/activation/terminalEnvVarCollectionService.unit.test.ts +++ b/src/test/interpreters/activation/terminalEnvVarCollectionService.unit.test.ts @@ -341,6 +341,7 @@ suite('Terminal Environment Variable Collection Service', () => { test('Also prepend deactivate script location if available', async () => { reset(terminalDeactivateService); + when(terminalDeactivateService.initializeScriptParams(anything())).thenResolve(); when(terminalDeactivateService.getScriptLocation(anything(), anything())).thenResolve('scriptLocation'); const processEnv = { PATH: 'hello/1/2/3' }; reset(environmentActivationService); @@ -409,6 +410,7 @@ suite('Terminal Environment Variable Collection Service', () => { test('Prepend full PATH with separator otherwise', async () => { reset(terminalDeactivateService); + when(terminalDeactivateService.initializeScriptParams(anything())).thenResolve(); when(terminalDeactivateService.getScriptLocation(anything(), anything())).thenResolve('scriptLocation'); const processEnv = { PATH: 'hello/1/2/3' }; reset(environmentActivationService);