Skip to content

Commit

Permalink
Fire group service instance change event when switching
Browse files Browse the repository at this point in the history
Fixes #127343
  • Loading branch information
Tyriar committed Jun 28, 2021
1 parent 1b68832 commit 8ab8d2a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -288,14 +288,15 @@ export class TerminalGroupService extends Disposable implements ITerminalGroupSe
}

this.activeInstanceIndex = instanceLocation.instanceIndex;
this.activeGroupIndex = instanceLocation.groupIndex;

if (this.activeGroupIndex !== instanceLocation.groupIndex) {
this.activeGroupIndex = instanceLocation.groupIndex;
this._onDidChangeActiveGroup.fire(this.activeGroup);
}
this.groups.forEach((g, i) => g.setVisible(i === instanceLocation.groupIndex));

instanceLocation.group.setActiveInstanceByIndex(this.activeInstanceIndex);
this._onDidChangeActiveInstance.fire(newActiveInstance);
}

setActiveGroupToNext() {
Expand Down
1 change: 1 addition & 0 deletions src/vs/workbench/contrib/terminal/browser/terminalView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ class SingleTerminalTabActionViewItem extends MenuEntryActionViewItem {
this._register(this._terminalService.onInstancePrimaryStatusChanged(e => this.updateLabel(e)));
this._register(_terminalGroupService.onDidChangeActiveInstance(() => this.updateLabel()));
this._register(this._terminalService.onInstanceIconChanged(e => this.updateLabel(e)));
this._register(this._terminalService.onInstanceColorChanged(e => this.updateLabel(e)));
this._register(this._terminalService.onInstanceTitleChanged(e => {
if (e === this._terminalGroupService.activeInstance) {
this._action.tooltip = getSingleTabTooltip(e);
Expand Down

0 comments on commit 8ab8d2a

Please sign in to comment.