File tree 1 file changed +13
-0
lines changed
src/vs/workbench/contrib/terminal/browser
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -238,9 +238,22 @@ export class TerminalGroupService extends Disposable implements ITerminalGroupSe
238
238
* group has been removed.
239
239
*/
240
240
setActiveGroupByIndex ( index : number , force ?: boolean ) {
241
+ // Unset active group when the last group is removed
242
+ if ( index === - 1 && this . groups . length === 0 ) {
243
+ if ( this . activeGroupIndex !== - 1 ) {
244
+ this . activeGroupIndex = - 1 ;
245
+ this . _onDidChangeActiveGroup . fire ( this . activeGroup ) ;
246
+ this . _onDidChangeActiveInstance . fire ( this . activeInstance ) ;
247
+ }
248
+ return ;
249
+ }
250
+
251
+ // Ensure index is valid
241
252
if ( index < 0 || index >= this . groups . length ) {
242
253
return ;
243
254
}
255
+
256
+ // Fire group/instance change if needed
244
257
const oldActiveGroup = this . activeGroup ;
245
258
this . activeGroupIndex = index ;
246
259
if ( force || oldActiveGroup !== this . activeGroup ) {
You can’t perform that action at this time.
0 commit comments