Skip to content

Commit

Permalink
Revert "create process in an empty workspace when cwd is userHome (#1…
Browse files Browse the repository at this point in the history
…41660)"

This reverts commit a58b538.
  • Loading branch information
meganrogge committed Jan 28, 2022
1 parent c3b73d3 commit 1b9ddd3
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions src/vs/workbench/contrib/terminal/browser/terminalInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ import { TerminalCapability } from 'vs/workbench/contrib/terminal/common/capabil
import { ITextModel } from 'vs/editor/common/model';
import { IModelService } from 'vs/editor/common/services/model';
import { ITextModelContentProvider, ITextModelService } from 'vs/editor/common/services/resolverService';
import { IHistoryService } from 'vs/workbench/services/history/common/history';
import { Schemas } from 'vs/base/common/network';

const enum Constants {
/**
Expand Down Expand Up @@ -352,8 +350,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
@IWorkbenchEnvironmentService workbenchEnvironmentService: IWorkbenchEnvironmentService,
@IWorkspaceContextService private readonly _workspaceContextService: IWorkspaceContextService,
@IEditorService private readonly _editorService: IEditorService,
@IWorkspaceTrustRequestService private readonly _workspaceTrustRequestService: IWorkspaceTrustRequestService,
@IHistoryService private readonly _historyService: IHistoryService
@IWorkspaceTrustRequestService private readonly _workspaceTrustRequestService: IWorkspaceTrustRequestService
) {
super();

Expand Down Expand Up @@ -1315,16 +1312,9 @@ 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._userHome && this._cwd !== this._userHome) {
// ensure that the process is launched in userHome for an empty workspace
this._shellLaunchConfig.cwd = this._userHome;
} else if (!this._userHome) {

const trusted = await this._trust();
if (!trusted) {
this._onProcessExit({ message: nls.localize('workspaceNotTrustedCreateTerminal', "Cannot launch a terminal process in an untrusted workspace") });
}

Expand Down

0 comments on commit 1b9ddd3

Please sign in to comment.