Skip to content

Comments

feat(core): centralize compatibility checks and add TrueColor detection#19478

Merged
spencer426 merged 16 commits intomainfrom
issue-17132-env-compat-warning
Feb 19, 2026
Merged

feat(core): centralize compatibility checks and add TrueColor detection#19478
spencer426 merged 16 commits intomainfrom
issue-17132-env-compat-warning

Conversation

@spencer426
Copy link
Contributor

@spencer426 spencer426 commented Feb 18, 2026

Summary

This PR moves the environment compatibility warnings logic from packages/cli to packages/core. This refactoring allows other consumers of the core package to benefit from these checks and improves the overall architectural separation of concerns.

Details

  • Relocated compatibility.ts and compatibility.test.ts from packages/cli/src/utils/ to packages/core/src/utils/.
  • Updated packages/core/src/index.ts to export the compatibility check functions.
  • Updated packages/cli/src/utils/userStartupWarnings.ts and its corresponding tests to import from @google/gemini-cli-core.
  • Adds warnings for the following:
    Windows 10: It detects if the OS is specifically Windows 10 (build < 22000).
    Warning: "⚠️ Windows 10 detected. Some UI features like smooth scrolling may be degraded. Windows 11 is recommended for the best
    experience."
Screenshot 2026-02-18 at 6 11 25 PM

JetBrains Terminal: It checks if the TERMINAL_EMULATOR environment variable is set to JetBrains-JediTerm.
Warning: "⚠️ JetBrains terminal detected. You may experience rendering or scrolling issues. Using an external terminal (e.g.,
Windows Terminal, iTerm2) is recommended."
Screenshot 2026-02-18 at 6 07 27 PM

True Color Support: It checks if the terminal supports 24-bit color by looking at the COLORTERM environment variable and
process.stdout.getColorDepth().
Warning: "⚠️ True color (24-bit) support not detected. Using a terminal with true color enabled will result in a better visual
experience."

Screenshot 2026-02-18 at 6 08 36 PM

Related Issues

Related to #17132

How to Validate

  1. JetBrains Terminal
    Run this in your shell to fake being inside a JetBrains IDE:

1 TERMINAL_EMULATOR=JetBrains-JediTerm npm run build-and-start

  1. No True Color Support
    Run this to hide true color support (note: this might not work if your terminal's stdout still reports
    depth, but it's the first check):
    1 COLORTERM= npm run build-and-start

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

Introduces a
ormalizePath utility function to provide consistent
path representations across different operating systems. It resolves
paths to absolute, converts backslashes to forward slashes, and
handles Windows case-insensitivity by lowercasing the path.

fix(tests): Improve tool confirmation test stability

Refactors the confirmation.test.ts to ensure reliable execution of
asynchronous test cases by correctly mocking and handling the
sequence of events in the tool confirmation flow.
- Move updateArgs assertion in confirmation.test.ts to match execution timing.
- Update shortenPath to handle both forward and backward slashes.
- Refactor isWithinRoot to use normalizePath for consistent Windows behavior.
- Use forward slashes for trailing separators in normalized paths.
- Fix assertion placement for updateArgs in ModifyWithEditor loop.
- Remove redundant awaitConfirmation unit tests covered by resolveConfirmation integration.
- Move updateArgs assertion to accurately reflect execution flow.
- Retain resolveEditorAsync mock with clarification to ensure test stability.
@spencer426 spencer426 requested review from a team as code owners February 18, 2026 22:11
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @spencer426, 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 significantly refactors the application's compatibility warning system by centralizing the logic within the core package. This change allows for broader utility of these checks beyond just the CLI, promoting a more modular and maintainable codebase. It also introduces new documentation to inform users about supported environments and provides a new setting to control the display of these warnings.

Highlights

  • Refactoring Compatibility Logic: The environment compatibility warnings logic has been moved from the packages/cli to the packages/core package, enhancing architectural separation and reusability for other consumers of the core package.
  • New Core Utilities: New utility functions (isWindows10, isJetBrainsTerminal, getCompatibilityWarnings) have been introduced in packages/core to detect specific OS and terminal environments and generate relevant warnings.
  • CLI Integration: The CLI's startup warnings mechanism has been updated to import and utilize the new compatibility warning functions from the core package, respecting a new ui.showCompatibilityWarnings setting.
  • Documentation Updates: New documentation has been added (docs/compatibility.md) detailing supported operating systems and terminal environments, and existing documentation has been updated to reflect the new compatibility warning setting.
  • Testing Improvements: Unit tests for compatibility detection have been added in packages/core, and existing CLI tests have been updated to mock the new core functions and ensure proper use of vi.restoreAllMocks().
Changelog
  • docs/cli/settings.md
    • Added a new entry for ui.showCompatibilityWarnings to the CLI settings documentation.
  • docs/compatibility.md
    • Created a new documentation page detailing supported operating systems and terminal environments.
  • docs/get-started/configuration.md
    • Documented the new ui.showCompatibilityWarnings setting in the configuration guide.
  • docs/index.md
    • Added a link to the new compatibility documentation in the main index.
  • docs/sidebar.json
    • Added a 'Compatibility' link to the documentation sidebar.
  • packages/cli/src/config/settingsSchema.ts
    • Defined the ui.showCompatibilityWarnings setting within the CLI's settings schema.
  • packages/cli/src/utils/userStartupWarnings.test.ts
    • Imported getCompatibilityWarnings from @google/gemini-cli-core.
    • Mocked getCompatibilityWarnings to control test scenarios.
    • Updated afterEach to use vi.restoreAllMocks() for better test isolation.
    • Added new tests to verify the integration and conditional display of compatibility warnings.
  • packages/cli/src/utils/userStartupWarnings.ts
    • Imported getCompatibilityWarnings from the core package.
    • Integrated the output of getCompatibilityWarnings into the startup warnings logic, respecting the showCompatibilityWarnings setting.
  • packages/core/src/index.ts
    • Exported all functions from the new utils/compatibility.js module to make them accessible to other packages.
  • packages/core/src/utils/compatibility.test.ts
    • Added a new test file for the isWindows10, isJetBrainsTerminal, and getCompatibilityWarnings functions, including mocking node:os and environment variables.
  • packages/core/src/utils/compatibility.ts
    • Created a new utility file containing functions to detect Windows 10 (isWindows10), JetBrains terminals (isJetBrainsTerminal), and generate compatibility warning messages (getCompatibilityWarnings).
  • schemas/settings.schema.json
    • Added the showCompatibilityWarnings property to the global settings JSON schema, including its title, description, and default value.
Activity
  • Documentation and README files were updated to reflect the changes.
  • New tests were added and existing tests were updated to cover the refactored logic.
  • The changes have been validated on MacOS and Linux using npm run.
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.

Copy link
Contributor

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

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 is a well-executed refactor, moving environment compatibility warning logic from the CLI package to the Core package. This improves modularity and allows other consumers of @google/gemini-cli-core to use these checks. The changes are accompanied by new tests and documentation updates. I've pointed out a minor inconsistency in a new test file regarding mock cleanup to ensure it aligns with the project's strict testing conventions mentioned in the PR description.

@gemini-cli
Copy link
Contributor

gemini-cli bot commented Feb 18, 2026

Hi @spencer426, thank you so much for your contribution to Gemini CLI! We really appreciate the time and effort you've put into this.

We're making some updates to our contribution process to improve how we track and review changes. Please take a moment to review our recent discussion post: Improving Our Contribution Process & Introducing New Guidelines.

Key Update: Starting January 26, 2026, the Gemini CLI project will require all pull requests to be associated with an existing issue. Any pull requests not linked to an issue by that date will be automatically closed.

Thank you for your understanding and for being a part of our community!

@gemini-cli gemini-cli bot added the area/core Issues related to User Interface, OS Support, Core Functionality label Feb 18, 2026
@github-actions
Copy link

github-actions bot commented Feb 18, 2026

Size Change: +2.49 kB (+0.01%)

Total Size: 24.5 MB

Filename Size Change
./bundle/gemini.js 24.5 MB +2.49 kB (+0.01%)
ℹ️ View Unchanged
Filename Size
./bundle/sandbox-macos-permissive-open.sb 890 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB
./bundle/sandbox-macos-strict-open.sb 4.82 kB
./bundle/sandbox-macos-strict-proxied.sb 5.02 kB

compressed-size-action

@spencer426 spencer426 changed the title refactor(core): move compatibility warnings logic from CLI to Core feat(core): centralize compatibility checks and add TrueColor detection Feb 18, 2026
@spencer426 spencer426 linked an issue Feb 18, 2026 that may be closed by this pull request
@spencer426 spencer426 enabled auto-merge February 18, 2026 23:57
@spencer426 spencer426 added this pull request to the merge queue Feb 19, 2026
Merged via the queue into main with commit c623406 Feb 19, 2026
26 of 27 checks passed
@spencer426 spencer426 deleted the issue-17132-env-compat-warning branch February 19, 2026 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core Issues related to User Interface, OS Support, Core Functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Report unsupported Windows versions or environments

2 participants