Skip to content
Merged
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
16 changes: 7 additions & 9 deletions src/vs/workbench/contrib/terminal/browser/terminalInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
@IAccessibilityService private readonly _accessibilityService: IAccessibilityService,
@IProductService private readonly _productService: IProductService,
@IQuickInputService private readonly _quickInputService: IQuickInputService,
@IWorkbenchEnvironmentService workbenchEnvironmentService: IWorkbenchEnvironmentService,
@IWorkbenchEnvironmentService private readonly _workbenchEnvironmentService: IWorkbenchEnvironmentService,
@IWorkspaceContextService private readonly _workspaceContextService: IWorkspaceContextService,
@IEditorService private readonly _editorService: IEditorService,
@IWorkspaceTrustRequestService private readonly _workspaceTrustRequestService: IWorkspaceTrustRequestService,
Expand Down Expand Up @@ -509,7 +509,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
// which would result in the wrong profile being selected and the wrong icon being
// permanently attached to the terminal. This also doesn't work when the default profile
// setting is set to null, that's handled after the process is created.
if (!this.shellLaunchConfig.executable && !workbenchEnvironmentService.remoteAuthority) {
if (!this.shellLaunchConfig.executable && !this._workbenchEnvironmentService.remoteAuthority) {
this._terminalProfileResolverService.resolveIcon(this._shellLaunchConfig, OS);
}
this._icon = _shellLaunchConfig.attachPersistentProcess?.icon || _shellLaunchConfig.icon;
Expand Down Expand Up @@ -1530,13 +1530,11 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
if (this.isDisposed) {
return;
}
const activeWorkspaceRootUri = this._historyService.getLastActiveWorkspaceRoot(Schemas.file);
if (activeWorkspaceRootUri) {
const trusted = await this._trust();
if (!trusted) {
this._onProcessExit({ message: nls.localize('workspaceNotTrustedCreateTerminal', "Cannot launch a terminal process in an untrusted workspace") });
}
} else if (this._cwd && this._userHome && this._cwd !== this._userHome) {
const trusted = await this._trust();
// Allow remote and local terminals from remote to be created in untrusted remote workspace
if (!trusted && !this.remoteAuthority && !this._workbenchEnvironmentService.remoteAuthority) {
this._onProcessExit({ message: nls.localize('workspaceNotTrustedCreateTerminal', "Cannot launch a terminal process in an untrusted workspace") });
} else if (this._workspaceContextService.getWorkspace().folders.length === 0 && this._cwd && this._userHome && this._cwd !== this._userHome) {
// something strange is going on if cwd is not userHome in an empty workspace
this._onProcessExit({
message: nls.localize('workspaceNotTrustedCreateTerminalCwd', "Cannot launch a terminal process in an untrusted workspace with cwd {0} and userHome {1}", this._cwd, this._userHome)
Expand Down
Loading