Skip to content

Commit

Permalink
Revert "Merge pull request #188064 from microsoft/tyriar/r_1_80_18777…
Browse files Browse the repository at this point in the history
…2" (#189044)

This reverts commit 3d74d3a, reversing
changes made to 74f6148.
  • Loading branch information
alexr00 authored Jul 27, 2023
1 parent de56f40 commit f1307ca
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions src/vs/workbench/contrib/terminal/browser/terminalView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,9 @@ export class TerminalViewPane extends ViewPane {
return (decorationsEnabled === 'both' || decorationsEnabled === 'gutter') && this._configurationService.getValue(TerminalSettingId.ShellIntegrationEnabled);
}

private _initializeTerminal(checkRestoredTerminals: boolean) {
if (this.isBodyVisible() && this._terminalService.isProcessSupportRegistered && this._terminalService.connectionState === TerminalConnectionState.Connected) {
let shouldCreate = this._terminalGroupService.groups.length === 0;
// When triggered just after reconnection, also check there are no groups that could be
// getting restored currently
if (checkRestoredTerminals) {
shouldCreate &&= this._terminalService.restoredGroupCount === 0;
}
if (shouldCreate) {
this._terminalService.createTerminal({ location: TerminalLocation.Panel });
}
private _initializeTerminal() {
if (this.isBodyVisible() && this._terminalService.isProcessSupportRegistered && this._terminalService.connectionState === TerminalConnectionState.Connected && this._terminalService.restoredGroupCount === 0 && this._terminalGroupService.groups.length === 0) {
this._terminalService.createTerminal({ location: TerminalLocation.Panel });
}
}

Expand Down Expand Up @@ -175,7 +167,7 @@ export class TerminalViewPane extends ViewPane {
if (!this._terminalService.isProcessSupportRegistered) {
this._onDidChangeViewWelcomeState.fire();
}
this._initializeTerminal(false);
this._initializeTerminal();
// we don't know here whether or not it should be focused, so
// defer focusing the panel to the focus() call
// to prevent overriding preserveFocus for extensions
Expand All @@ -187,7 +179,7 @@ export class TerminalViewPane extends ViewPane {
}
this._terminalGroupService.updateVisibility();
}));
this._register(this._terminalService.onDidChangeConnectionState(() => this._initializeTerminal(true)));
this._register(this._terminalService.onDidChangeConnectionState(() => this._initializeTerminal()));
this.layoutBody(this._parentDomElement.offsetHeight, this._parentDomElement.offsetWidth);
}

Expand Down

0 comments on commit f1307ca

Please sign in to comment.