Skip to content

Commit 1b9ddd3

Browse files
committed
Revert "create process in an empty workspace when cwd is userHome (microsoft#141660)"
This reverts commit a58b538.
1 parent c3b73d3 commit 1b9ddd3

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

src/vs/workbench/contrib/terminal/browser/terminalInstance.ts

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ import { TerminalCapability } from 'vs/workbench/contrib/terminal/common/capabil
7373
import { ITextModel } from 'vs/editor/common/model';
7474
import { IModelService } from 'vs/editor/common/services/model';
7575
import { ITextModelContentProvider, ITextModelService } from 'vs/editor/common/services/resolverService';
76-
import { IHistoryService } from 'vs/workbench/services/history/common/history';
77-
import { Schemas } from 'vs/base/common/network';
7876

7977
const enum Constants {
8078
/**
@@ -352,8 +350,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
352350
@IWorkbenchEnvironmentService workbenchEnvironmentService: IWorkbenchEnvironmentService,
353351
@IWorkspaceContextService private readonly _workspaceContextService: IWorkspaceContextService,
354352
@IEditorService private readonly _editorService: IEditorService,
355-
@IWorkspaceTrustRequestService private readonly _workspaceTrustRequestService: IWorkspaceTrustRequestService,
356-
@IHistoryService private readonly _historyService: IHistoryService
353+
@IWorkspaceTrustRequestService private readonly _workspaceTrustRequestService: IWorkspaceTrustRequestService
357354
) {
358355
super();
359356

@@ -1315,16 +1312,9 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
13151312
if (this._isDisposed) {
13161313
return;
13171314
}
1318-
const activeWorkspaceRootUri = this._historyService.getLastActiveWorkspaceRoot(Schemas.file);
1319-
if (activeWorkspaceRootUri) {
1320-
const trusted = await this._trust();
1321-
if (!trusted) {
1322-
this._onProcessExit({ message: nls.localize('workspaceNotTrustedCreateTerminal', "Cannot launch a terminal process in an untrusted workspace") });
1323-
}
1324-
} else if (this._userHome && this._cwd !== this._userHome) {
1325-
// ensure that the process is launched in userHome for an empty workspace
1326-
this._shellLaunchConfig.cwd = this._userHome;
1327-
} else if (!this._userHome) {
1315+
1316+
const trusted = await this._trust();
1317+
if (!trusted) {
13281318
this._onProcessExit({ message: nls.localize('workspaceNotTrustedCreateTerminal', "Cannot launch a terminal process in an untrusted workspace") });
13291319
}
13301320

0 commit comments

Comments
 (0)