claude-code - 💡(How to fix) Fix [BUG] Chinese IME + slash command: pressing Enter during IME composition clears input instead of executing command [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
anthropics/claude-code#48209Fetched 2026-04-15 06:30:06
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×4commented ×1cross-referenced ×1

Root Cause

This issue appears to be a variant of the IME Enter key handling problem previously reported for Japanese IME (#8405, #8423, #8498). The root cause is likely that Claude Code does not distinguish between an IME composition Enter (used to confirm candidate selection) and a regular Enter (used to submit/clear input).

RAW_BUFFERClick to expand / collapse

Bug Description

When typing a slash command (e.g. /clear) with Chinese IME active in Ghostty terminal on macOS, pressing Enter to confirm the IME candidate causes the input text to disappear without executing the command.

Environment

  • Claude Code version: 2.1.108
  • Terminal: Ghostty
  • OS: macOS (Darwin 25.3.0)
  • Input method: macOS Chinese IME (Pinyin)

Steps to Reproduce

  1. Open Claude Code in Ghostty terminal
  2. Make sure Chinese IME is active (e.g., macOS built-in Pinyin input method)
  3. Type /clear — the IME shows a candidate popup (e.g., 1 clear 2 吃)
  4. Press Enter to confirm the IME composition

Expected Behavior

The IME candidate is confirmed, and the typed text /clear remains in the input field (or the slash command is executed correctly).

Actual Behavior

The input text disappears entirely. The command is neither executed nor retained.

Additional Context

This issue appears to be a variant of the IME Enter key handling problem previously reported for Japanese IME (#8405, #8423, #8498). The root cause is likely that Claude Code does not distinguish between an IME composition Enter (used to confirm candidate selection) and a regular Enter (used to submit/clear input).

Related issues:

  • #8405 — Pressing Enter to confirm IME (Japanese) conversion unintentionally sends the prompt
  • #8498 — Japanese IME input causes unintended message submission on Enter key after recent update
  • #22853 — Fix IME input for Vietnamese, Chinese, Japanese, Korean (character loss)
  • #38694 — Kitty keyboard protocol intercepts Caps Lock, breaking macOS IME switching

The issue is consistently reproducible whenever the IME candidate popup is visible while typing a slash command.

extent analysis

TL;DR

The issue can be mitigated by modifying the Enter key handling in Claude Code to distinguish between IME composition confirmation and regular input submission.

Guidance

  • Review the related issues (#8405, #8423, #8498, #22853, #38694) to understand the history and potential solutions for IME Enter key handling problems.
  • Investigate the current implementation of Enter key handling in Claude Code and consider adding a check to determine if the IME candidate popup is visible before processing the Enter key press.
  • Test potential fixes with different input methods (e.g., Japanese IME, Vietnamese IME) to ensure the solution is not specific to Chinese IME.
  • Consider adding a configuration option to allow users to customize the Enter key behavior when using IME.

Example

No code snippet is provided as the issue does not contain sufficient information about the current implementation.

Notes

The solution may require changes to the Claude Code core or the integration with the Ghostty terminal. The issue is specific to macOS and Chinese IME, but similar problems have been reported with other input methods.

Recommendation

Apply a workaround by modifying the Enter key handling in Claude Code to handle IME composition confirmation differently than regular input submission, as this is likely to be a more feasible solution than waiting for an upgrade to a fixed version.

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

claude-code - 💡(How to fix) Fix [BUG] Chinese IME + slash command: pressing Enter during IME composition clears input instead of executing command [1 comments, 2 participants]