fix(cli): handle tmux false positive background detection#27572
fix(cli): handle tmux false positive background detection#27572amelidev wants to merge 6 commits into
Conversation
Summary of ChangesHello, 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 improves the CLI's terminal background detection by introducing a heuristic to filter out common false positives reported by tmux. Additionally, it refines the theme compatibility check to respect user-defined configuration settings, ensuring that warnings are only triggered when automatic theme switching is active. Highlights
Using Gemini Code AssistThe 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
Customization To customize the 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 Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. 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. Footnotes
|
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request introduces a heuristic to ignore #ffffff terminal background color reports in tmux to prevent false positives (e.g., over mosh), and updates theme setup logic to respect the autoThemeSwitching setting. It also adds corresponding unit tests. The review feedback suggests restoring the modified global process.stdin.isTTY property in the new test file using an afterEach hook to prevent test environment pollution.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a heuristic to ignore #ffffff background color detections in tmux to prevent false positives (e.g., over mosh), and updates theme setup logic to respect the autoThemeSwitching setting. It also adds corresponding unit tests for these changes. A review comment suggests using optional chaining and nullish coalescing to safely access settings.merged.ui.autoThemeSwitching to prevent potential runtime errors if ui is undefined.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a heuristic to ignore #ffffff (white) terminal background color detections when running inside tmux, preventing false positives (e.g., over mosh) that could lead to applying an incorrect light theme. It also updates the theme setup logic to respect the autoThemeSwitching setting before warning about theme incompatibilities. Comprehensive unit tests have been added for both the terminal capability manager and the terminal theme setup. No review comments were provided.
Summary
Fixes a regression where Gemini CLI incorrectly detects a light terminal background (#ffffff) when running inside tmux (especially via mosh), leading to inappropriate theme switching and compatibility warnings.
Details
Fix
Design Decisions
Chosen to ignore pure white specifically in tmux as it's the standard false-positive report. Respecting the user's explicit auto-switch setting provides a clean escape hatch for complex terminal stacks.
Related Issues
Fixes the reported terminal background detection regression.
How to Validate
Pre-Merge Checklist