From 8ab8d2ae9515bfdb563d809d9be2a0cd41e462aa Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Mon, 28 Jun 2021 11:49:54 -0700 Subject: [PATCH] Fire group service instance change event when switching Fixes #127343 --- .../workbench/contrib/terminal/browser/terminalGroupService.ts | 3 ++- src/vs/workbench/contrib/terminal/browser/terminalView.ts | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/terminal/browser/terminalGroupService.ts b/src/vs/workbench/contrib/terminal/browser/terminalGroupService.ts index 38e6e2390fe59..d22cc77ca9346 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalGroupService.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalGroupService.ts @@ -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() { diff --git a/src/vs/workbench/contrib/terminal/browser/terminalView.ts b/src/vs/workbench/contrib/terminal/browser/terminalView.ts index 1cf585ab059d1..2fa04a0ccbec4 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalView.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalView.ts @@ -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);