diff --git a/src/client/terminals/envCollectionActivation/shellIntegrationService.ts b/src/client/terminals/envCollectionActivation/shellIntegrationService.ts index 71cfb18dd437..92bb98029892 100644 --- a/src/client/terminals/envCollectionActivation/shellIntegrationService.ts +++ b/src/client/terminals/envCollectionActivation/shellIntegrationService.ts @@ -15,6 +15,7 @@ import { IDisposableRegistry, IPersistentStateFactory } from '../../common/types import { sleep } from '../../common/utils/async'; import { traceError, traceVerbose } from '../../logging'; import { IShellIntegrationDetectionService } from '../types'; +import { isTrusted } from '../../common/vscodeApis/workspaceApis'; /** * This is a list of shells which support shell integration: @@ -151,10 +152,12 @@ export class ShellIntegrationDetectionService implements IShellIntegrationDetect * Creates a dummy terminal so that we are guaranteed a data write event for this shell type. */ private createDummyHiddenTerminal(shell: string) { - this.terminalManager.createTerminal({ - shellPath: shell, - hideFromUser: true, - }); + if (isTrusted()) { + this.terminalManager.createTerminal({ + shellPath: shell, + hideFromUser: true, + }); + } } }