macos: avoid duplicate appearance sync on tab focus (#12828)

Close #12825

Skip the initial emissions from the focused surface appearance
publishers after a tab focus change. The focused surface is already
synced immediately, so the initial Combine values only repeat the same
titlebar and background updates. Subsequent derived config and OSC
background changes still resync the window appearance.



https://github.com/user-attachments/assets/f229fb95-4b4c-4040-85ac-0acfcc54ca82



Assigned to Codex GPT 5.5(medium)
PS: Sry for I don't write zig and let AI write this.
pull/12836/head
Mitchell Hashimoto 2026-05-27 07:52:42 -07:00 committed by GitHub
commit 3103ae8838
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

@ -1410,9 +1410,11 @@ class TerminalController: BaseTerminalController, TabGroupCloseCoordinator.Contr
// We also want to get notified of certain changes to update our appearance. // We also want to get notified of certain changes to update our appearance.
focusedSurface.$derivedConfig focusedSurface.$derivedConfig
.dropFirst()
.sink { [weak self, weak focusedSurface] _ in self?.syncAppearanceOnPropertyChange(focusedSurface) } .sink { [weak self, weak focusedSurface] _ in self?.syncAppearanceOnPropertyChange(focusedSurface) }
.store(in: &surfaceAppearanceCancellables) .store(in: &surfaceAppearanceCancellables)
focusedSurface.$backgroundColor focusedSurface.$backgroundColor
.dropFirst()
.sink { [weak self, weak focusedSurface] _ in self?.syncAppearanceOnPropertyChange(focusedSurface) } .sink { [weak self, weak focusedSurface] _ in self?.syncAppearanceOnPropertyChange(focusedSurface) }
.store(in: &surfaceAppearanceCancellables) .store(in: &surfaceAppearanceCancellables)
} }