codex - 💡(How to fix) Fix Bug: IME composition (e.g. Chinese input) committed on Enter instead of confirming composition [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
openai/codex#23440Fetched 2026-05-20 03:50:07
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×3commented ×1unlabeled ×1

Root Cause

Root Cause (Likely)

Code Example

if (event.key === "Enter" && !event.isComposing) {
  // submit
}
RAW_BUFFERClick to expand / collapse

Bug Description

When using an IME (Input Method Editor) for CJK input (e.g., Chinese Pinyin, Japanese IME), pressing Enter during IME composition directly submits the message instead of confirming the IME input first.

Environment: Codex VS Code Extension

Steps to Reproduce

  1. Open the Codex extension in VS Code
  2. When the agent asks a question and the input box is active, switch to a Chinese IME (e.g., Pinyin)
  3. Type a pinyin sequence (e.g., "nihao") — the IME shows candidate characters in a composition window
  4. Press Enter to confirm/select the IME composition

Expected Behavior

The first Enter should commit the IME composition text into the input box. The user can then press Enter again to submit.

Actual Behavior

The Enter key bypasses the IME composition and directly submits whatever was already in the input box. The IME input is lost.

Root Cause (Likely)

The input handler is likely listening to keydown events without checking event.isComposing. When an IME is active, isComposing is true, and the Enter key should be allowed to pass through to the IME rather than triggering submission.

Suggested Fix

Add an IME composition guard in the Enter key handler:

if (event.key === "Enter" && !event.isComposing) {
  // submit
}

Also consider listening to compositionstart / compositionend events to track IME state explicitly, as isComposing support varies across platforms.

Environment

  • OS: macOS (likely affects all platforms with CJK IME)
  • Codex VS Code Extension: latest
  • IME: macOS built-in Chinese Pinyin input

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

codex - 💡(How to fix) Fix Bug: IME composition (e.g. Chinese input) committed on Enter instead of confirming composition [1 comments, 2 participants]