@@ -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