Skip to content

About

Tiny macOS menu bar app that prevents accidental Return-to-submit in Codex while using Japanese IME.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Codex Enter Guard

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.

What It Does

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.

Install

Build the app:

./scripts/build.sh

Run it:

open .build/CodexEnterGuard.app

macOS 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: running
  • CEG!: permissions are missing or the event tap could not start
  • CEG-: disabled from the menu

Privacy

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.

Limitations

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.

Why Not Karabiner?

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.

Uninstall

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

Build Requirements

  • macOS
  • Xcode command line tools
  • Swift 6 or newer

Disclaimer

This is an unofficial utility. It is not affiliated with OpenAI, Codex, Apple, or Karabiner-Elements.

About

Tiny macOS menu bar app that prevents accidental Return-to-submit in Codex while using Japanese IME.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages