Skip to content

Bug: Chinese IME composition is not handled correctly in the CLI #5833

@shufan123456

Description

@shufan123456

What happened?

Describe the bug
The command-line interface (CLI) does not correctly handle the composition process of Chinese Pinyin Input Method Editors (IMEs). When a user types a pinyin string (e.g.,
"nihao") and then presses the spacebar to select the Chinese characters, the input is processed incorrectly, leaving only the last letter of the pinyin string in the input field
instead of the composed Chinese characters.

To Reproduce
Steps to reproduce the behavior:

  1. Switch the operating system's input method to a Chinese Pinyin IME.
  2. Focus the Gemini CLI input prompt.
  3. Type a pinyin string, for example, nihao.
  4. Press the Spacebar key to confirm the IME composition.

What did you expect to happen?

Expected behavior
The pinyin string nihao should be replaced by the corresponding Chinese characters 你好 in the input field.

Actual behavior
The input field displays only the last character of the pinyin string, which is o.

Client information

Details

Desktop:

  • OS: macOS (darwin)

Additional context
This issue makes it impossible to type Chinese directly into the CLI, forcing users to type in another application and then copy-paste the text. This significantly hinders the
user experience for Chinese-speaking users.

$ gemini /about

2.5 pro

</details>


### Login information

_No response_

### Anything else we need to know?

_No response_

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stalepriority/p2Important but can be addressed in a future release.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions