IME composition Enter key triggers prompt submission before conversion is confirmed

Resolved 💬 5 comments Opened Apr 15, 2026 by saitoko Closed May 24, 2026

Summary

When using an Input Method Editor (IME) — required for Japanese, Chinese, Korean, and other CJK languages — pressing Enter to confirm a character conversion also submits the prompt, causing unintended early submissions.

Problem Description

IME-based input involves two distinct Enter key events:

  1. Composition Enter — confirms the selected candidate (e.g., converting hiragana → kanji). This Enter should not submit the prompt.
  2. Submit Enter — the user intentionally sends the completed prompt. This Enter should submit.

Claude Code currently does not distinguish between these two cases. As a result, users who type in Japanese, Chinese, Korean, or any other IME-based language frequently submit incomplete prompts mid-composition.

Steps to Reproduce

  1. Set your system input method to Japanese (or any CJK IME).
  2. Open Claude Code in the terminal.
  3. Type a Japanese word using romaji input (e.g., type nihongo).
  4. Press Enter to confirm the IME conversion (e.g., 日本語).
  5. Observed: The prompt is submitted immediately with partially composed or empty text.
  6. Expected: Only the IME conversion is confirmed; the prompt remains editable.

Impact

This affects all users whose language requires an IME, including:

  • Japanese
  • Chinese (Simplified / Traditional)
  • Korean
  • And other languages using composition-based input

This is a significant usability barrier for a large portion of Claude Code's user base.

Current Workaround and Its Limitations

A commonly suggested workaround is to remap keys in keybindings.json:

  • enter → newline
  • ctrl+enter → submit

However, this is not viable for terminal (CLI) users because terminals cannot distinguish Ctrl+Enter from Enter at the key event level. Users who work across terminal, VS Code extension, and desktop app have no consistent solution.

Proposed Fix

IME state can be detected via the composition event API:

  • compositionstart — fired when IME composition begins
  • compositionend — fired when composition is confirmed

By tracking whether a compositionend event has fired, the Enter handler can determine whether the key press is a composition confirmation (ignore for submission) or a genuine submit action.

Pseudocode:

let isComposing = false;

input.addEventListener('compositionstart', () => { isComposing = true; });
input.addEventListener('compositionend', () => { isComposing = false; });

input.addEventListener('keydown', (e) => {
  if (e.key === 'Enter' && !isComposing) {
    submitPrompt();
  }
});

This is a well-established pattern used by VS Code, Slack, and other editors to handle IME input correctly.

References

Environment

  • Affected environments: Terminal (CLI), potentially VS Code extension and desktop app
  • Affected OS: macOS, Windows, Linux (any system with CJK IME enabled)

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗