codex - 💡(How to fix) Fix IME composition Enter is not guarded on macOS desktop app

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…

Code Example

if (event.isComposing || event.keyCode === 229) {
  return;
}

---

function onKeyDown(event) {
  if (event.isComposing || event.keyCode === 229) {
    return;
  }

  if (event.key === 'Enter') {
    // existing Enter behavior
  }
}

---

https://developer.mozilla.org/en-US/docs/Web/API/Element/keydown_event
RAW_BUFFERClick to expand / collapse

What version of the Codex App are you using (From “About Codex” dialog)?

latest

What subscription do you have?

pro plan 200usd

What platform is your computer?

No response

What issue are you seeing?

Issue

On the macOS desktop app, pressing Enter while using an IME composition flow may incorrectly trigger the Enter handler before the composition is finished.

It looks like the desktop version may be missing a guard like:

if (event.isComposing || event.keyCode === 229) {
  return;
}

This can cause Enter-to-submit / Enter-to-send behavior to fire while the user is still selecting or confirming composed text, especially for CJK input methods.

Expected behavior

When the user is composing text with an IME, Enter should not trigger submit/send behavior.

The keydown handler should ignore Enter while composition is active.

Suggested fix

Add an IME guard before handling Enter:

function onKeyDown(event) {
  if (event.isComposing || event.keyCode === 229) {
    return;
  }

  if (event.key === 'Enter') {
    // existing Enter behavior
  }
}

MDN also documents this pattern for keydown handlers:

https://developer.mozilla.org/en-US/docs/Web/API/Element/keydown_event

Although keyCode is deprecated, MDN notes that keyCode === 229 is still useful for IME cases where isComposing may be false due to event timing. (THIS IS THE ONLY WAY!!!)

What steps can reproduce the bug?

use it normally

What is the expected behavior?

No response

Additional information

No response

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…

FAQ

Expected behavior

When the user is composing text with an IME, Enter should not trigger submit/send behavior.

The keydown handler should ignore Enter while composition is active.

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 IME composition Enter is not guarded on macOS desktop app