A tiny 128 KB macOS menu bar app for one very specific problem:
Japanese IME composition + Codex desktop + one accidental Return = prompt submitted too early.
It is intentionally small: no DriverKit extension, no network access, no analytics, and no dependency on Karabiner-Elements.
When all of these are true:
- the frontmost app is Codex (
com.openai.codex) - the current keyboard input source is Japanese
- Return is pressed without Shift, Command, Option, or Control
Codex Enter Guard changes Return behavior:
- Return tap: sends
Control-M - Return hold for 300 ms: sends normal Return
- Shift-Return, Command-Return, Option-Return, and Control-Return: left untouched
This is meant for Japanese IME confirmation flows where a quick Return should confirm composition, not accidentally submit a prompt.
That is the whole app. No general key remapping. No profiles. No rules engine.
Build the app:
./scripts/build.shRun it:
open .build/CodexEnterGuard.appmacOS will require Input Monitoring and Accessibility permission before the event tap can work. Open the menu bar item, choose Open Permissions, then allow Codex Enter Guard in the relevant Privacy & Security panes.
The app shows a small CEG menu bar item:
CEG: runningCEG!: permissions are missing or the event tap could not startCEG-: disabled from the menu
Codex Enter Guard watches keyboard events only to detect unmodified Return while Codex is frontmost and Japanese input is active. It does not send data anywhere. It does not log typed text.
The local log at ~/Library/Logs/CodexEnterGuard.log contains startup and permission status only.
This app cannot see Codex's internal UI state, so it cannot know whether you are specifically typing in Plan Mode's fourth custom option. The guard is intentionally scoped to the best OS-visible approximation: Codex frontmost plus Japanese input source.
Control-M works as an IME-confirmation-friendly substitute in the target workflow, but different apps or input methods may behave differently.
Karabiner-Elements is powerful, but it requires a DriverKit extension and is much broader than this problem needs. Codex Enter Guard is a tiny app-specific event tap for people who only want this one guardrail.
Quit the menu bar app, then delete the app bundle you built or copied.
If you granted permissions, remove Codex Enter Guard from:
- System Settings -> Privacy & Security -> Input Monitoring
- System Settings -> Privacy & Security -> Accessibility
- macOS
- Xcode command line tools
- Swift 6 or newer
This is an unofficial utility. It is not affiliated with OpenAI, Codex, Apple, or Karabiner-Elements.