src/vs/workbench/contrib/terminal/browser/terminalGroupService.ts/TerminalGroupService/setActiveInstanceByIndex
class TerminalGroupService:	setActiveInstanceByIndex(index: number) {
		const activeInstance = this.activeInstance;
		const instanceLocation = this._getInstanceLocation(index);
		const newActiveInstance = instanceLocation?.group.terminalInstances[instanceLocation.instanceIndex];
		if (!instanceLocation || activeInstance === newActiveInstance) {
			return;
		}

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

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

		instanceLocation.group.setActiveInstanceByIndex(this.activeInstanceIndex);
	}