fix(cli): resolve autoThemeSwitching when background hasn't changed but theme mismatches (#20706)

This commit is contained in:
Sehoon Shon
2026-02-28 18:22:10 -05:00
committed by GitHub
parent a153ff587b
commit 6757d4b5c5
2 changed files with 40 additions and 8 deletions
+10 -8
View File
@@ -59,14 +59,6 @@ export function useTerminalTheme(
if (!hexColor) return;
const previousColor = config.getTerminalBackground();
if (previousColor === hexColor) {
return;
}
config.setTerminalBackground(hexColor);
themeManager.setTerminalBackground(hexColor);
const luminance = getLuminance(hexColor);
const currentThemeName = settings.merged.ui.theme;
@@ -77,6 +69,16 @@ export function useTerminalTheme(
DefaultLight.name,
);
if (previousColor === hexColor) {
if (newTheme) {
void handleThemeSelect(newTheme, SettingScope.User);
}
return;
}
config.setTerminalBackground(hexColor);
themeManager.setTerminalBackground(hexColor);
if (newTheme) {
void handleThemeSelect(newTheme, SettingScope.User);
} else {