mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-23 19:44:30 -07:00
fix(cli): resolve autoThemeSwitching when background hasn't changed but theme mismatches (#20706)
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user