IME composition Enter is not guarded on macOS desktop app
Open 💬 1 comment Opened May 18, 2026 by rockmandash
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:
```js
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_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗