diff --git a/Sources/ContentView.swift b/Sources/ContentView.swift index da5491e65..4b7534ad9 100644 --- a/Sources/ContentView.swift +++ b/Sources/ContentView.swift @@ -2005,7 +2005,7 @@ struct ContentView: View { } static func tmuxWorkspacePaneExactRect( - for panel: Panel, + for panel: any Panel, in contentView: NSView ) -> CGRect? { let targetView: NSView? diff --git a/Sources/GhosttyTerminalView.swift b/Sources/GhosttyTerminalView.swift index 517be0a06..f0d6e7d03 100644 --- a/Sources/GhosttyTerminalView.swift +++ b/Sources/GhosttyTerminalView.swift @@ -5647,6 +5647,14 @@ class GhosttyNSView: NSView, NSUserInterfaceValidations { } return } + // Push the current config to this surface before switching the color scheme. + // ghostty_surface_set_color_scheme alone only updates the scheme flag but does + // not re-apply the ANSI palette (OSC 4, colors 0-15) to the existing surface. + // Calling ghostty_surface_update_config first ensures the surface picks up the + // full palette for the new scheme (light/dark) from the current config. + if let config = GhosttyApp.shared.config { + ghostty_surface_update_config(surface, config) + } ghostty_surface_set_color_scheme(surface, scheme) appliedColorScheme = scheme if GhosttyApp.shared.backgroundLogEnabled {