@@ -125,17 +125,9 @@ export class TerminalViewPane extends ViewPane {
125
125
return ( decorationsEnabled === 'both' || decorationsEnabled === 'gutter' ) && this . _configurationService . getValue ( TerminalSettingId . ShellIntegrationEnabled ) ;
126
126
}
127
127
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 } ) ;
139
131
}
140
132
}
141
133
@@ -175,7 +167,7 @@ export class TerminalViewPane extends ViewPane {
175
167
if ( ! this . _terminalService . isProcessSupportRegistered ) {
176
168
this . _onDidChangeViewWelcomeState . fire ( ) ;
177
169
}
178
- this . _initializeTerminal ( false ) ;
170
+ this . _initializeTerminal ( ) ;
179
171
// we don't know here whether or not it should be focused, so
180
172
// defer focusing the panel to the focus() call
181
173
// to prevent overriding preserveFocus for extensions
@@ -187,7 +179,7 @@ export class TerminalViewPane extends ViewPane {
187
179
}
188
180
this . _terminalGroupService . updateVisibility ( ) ;
189
181
} ) ) ;
190
- this . _register ( this . _terminalService . onDidChangeConnectionState ( ( ) => this . _initializeTerminal ( true ) ) ) ;
182
+ this . _register ( this . _terminalService . onDidChangeConnectionState ( ( ) => this . _initializeTerminal ( ) ) ) ;
191
183
this . layoutBody ( this . _parentDomElement . offsetHeight , this . _parentDomElement . offsetWidth ) ;
192
184
}
193
185
0 commit comments