File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
src/vs/workbench/contrib/terminal/browser Expand file tree Collapse file tree 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
238238 * group has been removed.
239239 */
240240 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
241252 if ( index < 0 || index >= this . groups . length ) {
242253 return ;
243254 }
255+
256+ // Fire group/instance change if needed
244257 const oldActiveGroup = this . activeGroup ;
245258 this . activeGroupIndex = index ;
246259 if ( force || oldActiveGroup !== this . activeGroup ) {
You can’t perform that action at this time.
0 commit comments