Skip to content

fix(cli): stray 'm' character printed during terminal startup #19081

@srithreepo

Description

@srithreepo

What happened?

During startup, the Gemini CLI queries the terminal for capabilities (like modifyOtherKeys and Kitty protocol). On some terminals (e.g., Apple Terminal, certain tmux versions), this query results in a stray "m" character being printed to the command line, which can interfere with the user's input or display.

What did you expect to happen?

The terminal capability detection should happen silently in the background without leaving any visual artifacts like a stray "m" on the command line.

Client information

Client Information

Platform: macOS (Darwin)
Architecture: arm64
Version: 0.30.0-nightly (development)

Login information

Google Account (Gemini Code Assist)

Anything else we need to know?

The issue seems related to how certain terminals handle the modifyOtherKeys or Kitty protocol queries. Wrapping the queries in a hidden mode sequence and clearing the line afterwards resolves the visibility issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/coreIssues related to User Interface, OS Support, Core Functionalitykind/bugstatus/need-triageIssues that need to be triaged by the triage automation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions