Skip to content

Commit cfc65ab

Browse files
authored
fix: terminal error notification in untrusted workspace (#24993)
Fixes #24770
1 parent cf894bb commit cfc65ab

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Diff for: src/client/terminals/envCollectionActivation/shellIntegrationService.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { IDisposableRegistry, IPersistentStateFactory } from '../../common/types
1515
import { sleep } from '../../common/utils/async';
1616
import { traceError, traceVerbose } from '../../logging';
1717
import { IShellIntegrationDetectionService } from '../types';
18+
import { isTrusted } from '../../common/vscodeApis/workspaceApis';
1819

1920
/**
2021
* This is a list of shells which support shell integration:
@@ -151,10 +152,12 @@ export class ShellIntegrationDetectionService implements IShellIntegrationDetect
151152
* Creates a dummy terminal so that we are guaranteed a data write event for this shell type.
152153
*/
153154
private createDummyHiddenTerminal(shell: string) {
154-
this.terminalManager.createTerminal({
155-
shellPath: shell,
156-
hideFromUser: true,
157-
});
155+
if (isTrusted()) {
156+
this.terminalManager.createTerminal({
157+
shellPath: shell,
158+
hideFromUser: true,
159+
});
160+
}
158161
}
159162
}
160163

0 commit comments

Comments
 (0)