feat(cli): support independent light and dark mode themes

This commit is contained in:
Dan Zaharia
2026-02-26 16:50:26 -05:00
parent 717660997d
commit 98a0a2f0ef
25 changed files with 548 additions and 330 deletions

View File

@@ -597,6 +597,8 @@ export interface ConfigParameters {
billing?: {
overageStrategy?: OverageStrategy;
};
cliTheme?: string;
cliThemeMode?: 'light' | 'dark';
}
export class Config implements McpContext {
@@ -626,6 +628,8 @@ export class Config implements McpContext {
private readonly debugMode: boolean;
private readonly question: string | undefined;
readonly enableConseca: boolean;
private readonly cliTheme?: string;
private readonly cliThemeMode?: 'light' | 'dark';
private readonly coreTools: string[] | undefined;
/** @deprecated Use Policy Engine instead */
@@ -819,6 +823,9 @@ export class Config implements McpContext {
this.pendingIncludeDirectories = params.includeDirectories ?? [];
this.debugMode = params.debugMode;
this.question = params.question;
this.enableConseca = params.enableConseca ?? false;
this.cliTheme = params.cliTheme;
this.cliThemeMode = params.cliThemeMode;
this.coreTools = params.coreTools;
this.allowedTools = params.allowedTools;
@@ -1561,6 +1568,14 @@ export class Config implements McpContext {
return this.sandbox;
}
getCliTheme(): string | undefined {
return this.cliTheme;
}
getCliThemeMode(): 'light' | 'dark' | undefined {
return this.cliThemeMode;
}
isRestrictiveSandbox(): boolean {
const sandboxConfig = this.getSandbox();
const seatbeltProfile = process.env['SEATBELT_PROFILE'];

View File

@@ -51,7 +51,7 @@ describe('FolderTrustDiscoveryService', () => {
BeforeTool: [{ command: 'test-hook' }],
},
general: { vimMode: true },
ui: { theme: 'Dark' },
ui: { themeLight: 'Dark', themeDark: 'Dark' },
};
await fs.writeFile(
path.join(geminiDir, 'settings.json'),