Change:
Testing a multi folder workspace with 1 repository each the branch name updates in the statusbar, but not in the title bar until the user switches to a new tab/file
I don't repro this on Windows with a custom titlebar, but it does take a few seconds for the titlebar to change the title in my case.
Pushing a fix to for this issue. I do want to call out that the status bar item is being updated "optimistically" so that we can show a "loading" indicator while the checkout is in progress. Due to this there might be a delay in the title bar being updated as the title bar only updates when the checkout completed.
I'm seeing the same behaviour, meaning I might not have encountered the actual issue in the first place. could you verify this issue?
<!-- AUTHORVERIFICATIONREQUEST --This bug has been fixed in the latest release of ! you can help us out by commenting if things are now working as expected. If things still don't seem right, please ensure you're on version of Insiders (today's or later - you can use in the command palette to check), and leave a comment letting us know what isn't working as expected. Happy Coding!
Pinging about verification

Discussion:
private activeRepositoryNameContextKey: IContextKey<string>; private activeRepositoryBranchNameContextKey: IContextKey<string>; <ins> private focusedRepository: ISCMRepository | undefined = undefined; private focusDisposable: IDisposable = Disposable.None; </ins> private readonly disposables = new DisposableStore(); <del> private readonly focusedRepositoryDisposables = new DisposableStore(); </del> constructor( @IContextKeyService contextKeyService: IContextKeyService,

return; } <del> const activeResourceRepository = Iterable.find( this.scmViewService.visibleRepositories, </del> <ins> const repository = Iterable.find( this.scmViewService.repositories, </ins> r => Boolean(r.provider.rootUri && this.uriIdentityService.extUri.isEqualOrParent(activeResource, r.provider.rootUri)) ); <del> this.onDidFocusRepository(activeResourceRepository); </del> <ins> this.onDidFocusRepository(repository); </ins> } private onDidFocusRepository(repository: ISCMRepository | undefined): void { <del> this.focusedRepositoryDisposables.clear(); if (!repository) { </del> <ins> if (!repository || this.focusedRepository === repository) { </ins> return; } <del> this.focusedRepositoryDisposables.add(repository.provider.onDidChangeHistoryProvider(() => { if (repository.provider.historyProvider) { this.focusedRepositoryDisposables.add(repository.provider.historyProvider.onDidChangeCurrentHistoryItemGroup(() => this.updateContextKeys(repository))); } </del> <ins> this.focusDisposable.dispose(); this.focusedRepository = repository; </ins> <del> this.updateContextKeys(repository); })); </del> <ins> if (repository && repository.provider.onDidChangeStatusBarCommands) { this.focusDisposable = repository.provider.onDidChangeStatusBarCommands(() => this.updateContextKeys(repository)); } </ins> this.updateContextKeys(repository); }

this.activeRepositoryNameContextKey.set(repository?.provider.name ?? ''); this.activeRepositoryBranchNameContextKey.set(repository?.provider.historyProvider?.currentHistoryItemGroup?.label ?? ''); } <ins> dispose(): void { this.focusDisposable.dispose(); this.disposables.dispose(); } </ins> } export class SCMActiveResourceContextKeyController implements IWorkbenchContribution {