gemini-cli - 💡(How to fix) Fix UI Regression in v0.40.0+: Incorrect prompt background and height in WSL (TrueColor detection failure) [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
google-gemini/gemini-cli#26300Fetched 2026-05-01 05:52:38
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Author
Participants
Timeline (top)
labeled ×1

Root Cause

Technical Analysis:

The issue stems from the HalfLinePaddedBox component. In v0.40.0+, the CLI relies on supportsTrueColor() to decide between a "thin" UI (using and characters) and a fallback UI. In WSL, supportsTrueColor() returns false because COLORTERM is not set and getColorDepth() returns 8.

Fix Action

Fix / Workaround

Temporary Workaround:

Manually setting export COLORTERM=truecolor in ~/.bashrc fixes the issue, but this should be handled automatically by the CLI for better out-of-the-box experience in WSL.

Code Example

if (noTrueColor) {
  return (0, import_jsx_runtime.jsx)(Box_default, { 
    width: terminalWidth, 
    backgroundColor, 
    paddingY: 1, 
    children 
  });
}

---

About Gemini CLI                                                                                
                                                                                                
CLI Version                                 0.40.1                                              
Git Commit                                  7a382e066                                           
Model                                       Auto (Gemini 3)                                     
Sandbox                                     no sandbox                                          
OS                                          linux                                               
Auth Method                                 Signed in with Google (***)   
Tier                                        Gemini Code Assist in Google One AI Pro
RAW_BUFFERClick to expand / collapse

What happened?

Description:

After upgrading to Gemini CLI v0.40.0+, the prompt input field in WSL (Windows Subsystem for Linux) is rendered with an incorrect background color (light gray) and excessive height compared to the Windows/Native version.

Screenshots:

  • Bug in WSL:

    <img width="1682" height="343" alt="Image" src="https://github.com/user-attachments/assets/63c3df30-7ad2-4393-9693-22cc596c194d" />
  • Correct in Windows:

    <img width="1676" height="360" alt="Image" src="https://github.com/user-attachments/assets/d46b24fa-64d5-4ba0-8f10-c2d869d15b47" />

Environment:

  • OS: Windows 11 / WSL 2
  • Gemini CLI Version: v0.40.1
  • Node.js Version: v20+
  • Terminal: WSL (Ubuntu/bash) inside Windows Terminal

Diagnostics:

Running node -e "console.log('Depth:', process.stdout.getColorDepth(), 'ColorTerm:', process.env.COLORTERM)" in the affected WSL environment returns: Depth: 8 ColorTerm: undefined

Technical Analysis:

The issue stems from the HalfLinePaddedBox component. In v0.40.0+, the CLI relies on supportsTrueColor() to decide between a "thin" UI (using and characters) and a fallback UI. In WSL, supportsTrueColor() returns false because COLORTERM is not set and getColorDepth() returns 8.

This triggers the following fallback in interactiveCli-XXXX.js:

if (noTrueColor) {
  return (0, import_jsx_runtime.jsx)(Box_default, { 
    width: terminalWidth, 
    backgroundColor, 
    paddingY: 1, 
    children 
  });
}

The paddingY: 1 causes the field to be 3 lines tall, and the 8-bit color mapping for backgroundColor results in a light-gray color that clashes with the theme.

Temporary Workaround:

Manually setting export COLORTERM=truecolor in ~/.bashrc fixes the issue, but this should be handled automatically by the CLI for better out-of-the-box experience in WSL.

What did you expect to happen?

Expected behavior:

The prompt should detect TrueColor support in modern WSL environments (which usually support it) or provide a more compact fallback UI that matches the theme's aesthetics even in 8-bit mode.

Client information

About Gemini CLI                                                                                
                                                                                                
CLI Version                                 0.40.1                                              
Git Commit                                  7a382e066                                           
Model                                       Auto (Gemini 3)                                     
Sandbox                                     no sandbox                                          
OS                                          linux                                               
Auth Method                                 Signed in with Google (***)   
Tier                                        Gemini Code Assist in Google One AI Pro

Login information

No response

Anything else we need to know?

No response

extent analysis

TL;DR

The issue can be fixed by automatically setting COLORTERM=truecolor in the WSL environment or modifying the supportsTrueColor() function to correctly detect TrueColor support.

Guidance

  • Verify that the COLORTERM environment variable is set to truecolor in the WSL environment to ensure TrueColor support is detected.
  • Modify the supportsTrueColor() function to check for TrueColor support in modern WSL environments, which usually support it.
  • Consider adding a fallback UI that matches the theme's aesthetics even in 8-bit mode to improve the user experience.
  • Review the interactiveCli-XXXX.js file to ensure that the paddingY value is set correctly to avoid excessive height.

Example

// Example of how to set COLORTERM environment variable in JavaScript
process.env.COLORTERM = 'truecolor';

Notes

The current workaround requires manual intervention by setting export COLORTERM=truecolor in ~/.bashrc. A more robust solution would involve automatically detecting TrueColor support in the WSL environment.

Recommendation

Apply workaround: automatically set COLORTERM=truecolor in the WSL environment or modify the supportsTrueColor() function to correctly detect TrueColor support, as this provides a more seamless user experience in modern WSL environments.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

gemini-cli - 💡(How to fix) Fix UI Regression in v0.40.0+: Incorrect prompt background and height in WSL (TrueColor detection failure) [1 participants]