From 1c3f8458ee282c533a2cd5ce00d3904a74ec8f48 Mon Sep 17 00:00:00 2001 From: Lawrence Chen <54008264+lawrencecchen@users.noreply.github.com> Date: Mon, 23 Feb 2026 19:54:54 -0800 Subject: [PATCH] Clear stale surface bg override on config changes --- Sources/GhosttyTerminalView.swift | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Sources/GhosttyTerminalView.swift b/Sources/GhosttyTerminalView.swift index 914fc57b..aaea7a19 100644 --- a/Sources/GhosttyTerminalView.swift +++ b/Sources/GhosttyTerminalView.swift @@ -1245,6 +1245,18 @@ class GhosttyApp { } return true case GHOSTTY_ACTION_CONFIG_CHANGE: + if let staleOverride = surfaceView.backgroundColor { + surfaceView.backgroundColor = nil + if backgroundLogEnabled { + logBackground( + "surface override cleared tab=\(surfaceView.tabId?.uuidString ?? "nil") surface=\(surfaceView.terminalSurface?.id.uuidString ?? "nil") cleared=\(staleOverride.hexString()) source=action.config_change.surface" + ) + } + surfaceView.applySurfaceBackground() + DispatchQueue.main.async { + surfaceView.applyWindowBackgroundIfActive() + } + } updateDefaultBackground( from: action.action.config_change.config, source: "action.config_change.surface tab=\(surfaceView.tabId?.uuidString ?? "nil") surface=\(surfaceView.terminalSurface?.id.uuidString ?? "nil")",