Skip to content

Unset foreground in default themes#9765

Merged
miguelsolorio merged 8 commits into
mainfrom
miguelsolorio/default-themes-foreground
Sep 25, 2025
Merged

Unset foreground in default themes#9765
miguelsolorio merged 8 commits into
mainfrom
miguelsolorio/default-themes-foreground

Conversation

@miguelsolorio

@miguelsolorio miguelsolorio commented Sep 25, 2025

Copy link
Copy Markdown
Contributor

TLDR

This fixes a long standing issue where users on light terminals can't really see the text.

Dive Deeper

By unsetting the foreground color, it relies on using the terminal foreground color. This only applies to our default dark/light themes, other themes will have custom foreground colors.

Before

CleanShot 2025-09-25 at 15 16 16@2x

After

CleanShot 2025-09-25 at 15 17 05@2x

Reviewer Test Plan

Testing Matrix

🍏 🪟 🐧
npm run
npx
Docker
Podman - -
Seatbelt - -

Linked issues / bugs

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @miguelsolorio, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a long-standing readability issue by modifying the default lightTheme and darkTheme to no longer explicitly set a foreground color, allowing terminal emulators to dictate text color for better contrast. Additionally, it refines the fallback logic in a utility function to handle optional parameters more robustly, ensuring correct behavior when default colors are intentionally unset or provided as falsy values.

Highlights

  • Default Theme Foreground Colors: The Foreground color property has been unset in both the lightTheme and darkTheme definitions. This change allows the terminal's native foreground color to be used, which significantly improves text visibility for users on light terminals.
  • Improved Fallback Logic for getStatusColor: The getStatusColor utility function now uses a more precise !== undefined check for options.defaultColor instead of the || operator. This ensures that valid falsy values (like an empty string) for defaultColor are correctly applied, preventing unintended fallbacks to theme.status.error.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request effectively addresses the text visibility issue on light-themed terminals by unsetting the foreground color in the default themes, allowing the terminal's native color to be used. The accompanying change in displayUtils.ts is a crucial bug fix that ensures an empty string color value is handled correctly, preventing it from incorrectly falling back to an error color. I have one suggestion to improve code consistency.

Comment thread packages/cli/src/ui/utils/displayUtils.ts Outdated
@github-actions

github-actions Bot commented Sep 25, 2025

Copy link
Copy Markdown

Size Change: -16 B (0%)

Total Size: 17.4 MB

ℹ️ View Unchanged
Filename Size Change
./bundle/gemini.js 17.4 MB -16 B (0%)
./bundle/sandbox-macos-permissive-closed.sb 1.03 kB 0 B
./bundle/sandbox-macos-permissive-open.sb 830 B 0 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB 0 B
./bundle/sandbox-macos-restrictive-closed.sb 3.29 kB 0 B
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB 0 B
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB 0 B

compressed-size-action

@jacob314 jacob314 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

if (value >= thresholds.yellow) {
return theme.status.warning;
}
return options.defaultColor || theme.status.error;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you gemini cli catch this or did you manually debug to fix this? For what it is worth this seems wrong both before and after. Likely we should have a red/error threshold and return theme.status.error in that case
and always return options.defaultColor for this default case.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gemini originally made the change but then GCA suggested this instead (you can see the resolved thread above). Happy to add your suggestions.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me follow up in a subsequent PR to address this

@miguelsolorio miguelsolorio added this pull request to the merge queue Sep 25, 2025
Merged via the queue into main with commit 18e5113 Sep 25, 2025
17 of 18 checks passed
@miguelsolorio miguelsolorio deleted the miguelsolorio/default-themes-foreground branch September 25, 2025 22:20
geoffdowns pushed a commit to geoffdowns/gemini-cli that referenced this pull request Sep 26, 2025
dtometzki pushed a commit to dtometzki/gemini-cli that referenced this pull request Sep 26, 2025
jkcinouye pushed a commit that referenced this pull request Sep 29, 2025
thacio added a commit to thacio/auditaria that referenced this pull request Oct 4, 2025
giraffe-tree pushed a commit to giraffe-tree/gemini-cli that referenced this pull request Oct 10, 2025
cocosheng-g pushed a commit that referenced this pull request May 6, 2026
@sripasg sripasg added the size/xs An extra small PR label Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/xs An extra small PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants