Skip to content

Commit f1307ca

Browse files
authored
Revert "Merge pull request microsoft#188064 from microsoft/tyriar/r_1_80_187772" (microsoft#189044)
This reverts commit 3d74d3a, reversing changes made to 74f6148.
1 parent de56f40 commit f1307ca

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

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

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -125,17 +125,9 @@ export class TerminalViewPane extends ViewPane {
125125
return (decorationsEnabled === 'both' || decorationsEnabled === 'gutter') && this._configurationService.getValue(TerminalSettingId.ShellIntegrationEnabled);
126126
}
127127

128-
private _initializeTerminal(checkRestoredTerminals: boolean) {
129-
if (this.isBodyVisible() && this._terminalService.isProcessSupportRegistered && this._terminalService.connectionState === TerminalConnectionState.Connected) {
130-
let shouldCreate = this._terminalGroupService.groups.length === 0;
131-
// When triggered just after reconnection, also check there are no groups that could be
132-
// getting restored currently
133-
if (checkRestoredTerminals) {
134-
shouldCreate &&= this._terminalService.restoredGroupCount === 0;
135-
}
136-
if (shouldCreate) {
137-
this._terminalService.createTerminal({ location: TerminalLocation.Panel });
138-
}
128+
private _initializeTerminal() {
129+
if (this.isBodyVisible() && this._terminalService.isProcessSupportRegistered && this._terminalService.connectionState === TerminalConnectionState.Connected && this._terminalService.restoredGroupCount === 0 && this._terminalGroupService.groups.length === 0) {
130+
this._terminalService.createTerminal({ location: TerminalLocation.Panel });
139131
}
140132
}
141133

@@ -175,7 +167,7 @@ export class TerminalViewPane extends ViewPane {
175167
if (!this._terminalService.isProcessSupportRegistered) {
176168
this._onDidChangeViewWelcomeState.fire();
177169
}
178-
this._initializeTerminal(false);
170+
this._initializeTerminal();
179171
// we don't know here whether or not it should be focused, so
180172
// defer focusing the panel to the focus() call
181173
// to prevent overriding preserveFocus for extensions
@@ -187,7 +179,7 @@ export class TerminalViewPane extends ViewPane {
187179
}
188180
this._terminalGroupService.updateVisibility();
189181
}));
190-
this._register(this._terminalService.onDidChangeConnectionState(() => this._initializeTerminal(true)));
182+
this._register(this._terminalService.onDidChangeConnectionState(() => this._initializeTerminal()));
191183
this.layoutBody(this._parentDomElement.offsetHeight, this._parentDomElement.offsetWidth);
192184
}
193185

0 commit comments

Comments
 (0)