gemini-cli - 💡(How to fix) Fix [Bug]: Backspace deletes entire CJK character segments instead of a single character on Windows [1 comments, 2 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#26026Fetched 2026-04-28 06:50:23
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
closed ×1commented ×1labeled ×1
RAW_BUFFERClick to expand / collapse

What happened?

When typing mixed CJK (Chinese) and English text in the Gemini CLI on Windows, pressing the Backspace key (or Ctrl+H) deletes an entire contiguous segment of CJK characters at once, rather than deleting one character at a time.

Steps to reproduce:

  1. Type a string like: 你好,abcf这是什么啊
  2. Press Backspace once.
  3. Observed result: The entire segment 这是什么啊 is deleted in one hit.
  4. Press Backspace again.
  5. Observed result: The segment abcf is deleted.
  6. Press Backspace again.
  7. Observed result: The punctuation , is deleted.

Note: Interestingly, the Left Arrow key (cursor movement) and the Delete key (forward delete) both work correctly one character at a time.

What did you expect to happen?

I expected the Backspace key to delete only the single character immediately to the left of the cursor, regardless of whether it is a CJK character or an ASCII character.

Client information

Client information

  • Gemini CLI Version: 0.39.1
  • Operating System: Windows 10/11 (win32)
  • Terminal: Windows Terminal
  • Node.js Version: v22.12.0
  • TERM environment variable: xterm-256color
  • Vim Mode: Disabled

Login information

No response

Anything else we need to know?

No response

extent analysis

TL;DR

The issue can likely be resolved by adjusting the handling of Backspace key presses in the Gemini CLI to account for CJK characters.

Guidance

  • Investigate the current implementation of Backspace key handling in the Gemini CLI to identify why it's deleting entire segments of CJK characters at once.
  • Consider implementing a character-by-character deletion approach for the Backspace key, similar to how the Left Arrow key and Delete key work.
  • Review the Unicode handling in the Gemini CLI to ensure it correctly interprets CJK characters as individual characters rather than segments.
  • Test the Backspace key behavior with different CJK characters and languages to ensure the fix is comprehensive.

Example

No code snippet is provided due to the lack of specific implementation details in the issue.

Notes

The issue seems specific to the Windows platform and the Gemini CLI, so any fixes or workarounds may need to be tailored to this environment. The fact that the Left Arrow key and Delete key work correctly suggests that the issue is isolated to the Backspace key handling.

Recommendation

Apply a workaround to adjust the Backspace key handling in the Gemini CLI, as the root cause appears to be related to how CJK characters are processed.

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 [Bug]: Backspace deletes entire CJK character segments instead of a single character on Windows [1 comments, 2 participants]