From 8ebf4f70e5e8d0e2bf80a2b9c53ca85ca8d396e7 Mon Sep 17 00:00:00 2001 From: Lukas <134181853+bo2themax@users.noreply.github.com> Date: Sat, 25 Apr 2026 12:55:19 +0200 Subject: [PATCH] macOS: make tab color optional --- .../Sources/Features/Terminal/TerminalRestorable.swift | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/macos/Sources/Features/Terminal/TerminalRestorable.swift b/macos/Sources/Features/Terminal/TerminalRestorable.swift index aab51f6bd..1bf450bb2 100644 --- a/macos/Sources/Features/Terminal/TerminalRestorable.swift +++ b/macos/Sources/Features/Terminal/TerminalRestorable.swift @@ -46,14 +46,14 @@ class TerminalRestorableState: TerminalRestorable { let focusedSurface: String? let surfaceTree: SplitTree let effectiveFullscreenMode: FullscreenMode? - let tabColor: TerminalTabColor + let tabColor: TerminalTabColor? let titleOverride: String? init(from controller: TerminalController) { self.focusedSurface = controller.focusedSurface?.id.uuidString self.surfaceTree = controller.surfaceTree self.effectiveFullscreenMode = controller.fullscreenStyle?.fullscreenMode - self.tabColor = (controller.window as? TerminalWindow)?.tabColor ?? .none + self.tabColor = (controller.window as? TerminalWindow)?.tabColor self.titleOverride = controller.titleOverride } @@ -121,8 +121,10 @@ class TerminalWindowRestoration: NSObject, NSWindowRestoration { return } - // Restore our tab color - (window as? TerminalWindow)?.tabColor = state.tabColor + // Restore our tab color and avoid unnecessary `invalidateRestorableState` calls + if let tabColor = state.tabColor { + (window as? TerminalWindow)?.tabColor = tabColor + } // Restore the tab title override c.titleOverride = state.titleOverride