Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not throw if initializing deactivate script fails #22566

Merged
merged 2 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/client/terminals/envCollectionActivation/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<number | undefined, boolean>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
Loading