A small Windows helper that prevents accidental message submission while a CJK IME composition is active in the Codex desktop app.
Chinese, Japanese, and Korean IME users often press Enter to confirm a composition candidate. In chat-style coding tools, the same key can also submit the message. This tool adds a narrow Windows keyboard guard so Enter is blocked only when Codex is focused and the IME still has active composition text.
- Windows-only PowerShell helper with an embedded low-level keyboard hook.
- Default
compositionmode blocks Enter only during active IME composition. - Optional
plainandallmodes for debugging stricter behavior. - Preserves Shift+Enter, Ctrl+Enter, and Alt+Enter in
plainmode. - Uses a PID file so duplicate guards are avoided.
- Does not patch Codex, ChatGPT, or any installed application files.
powershell -NoProfile -ExecutionPolicy Bypass -File .\tools\start-codex-ime-enter-guard.ps1Stop the guard:
powershell -NoProfile -ExecutionPolicy Bypass -File .\tools\stop-codex-ime-enter-guard.ps1Run a lightweight self-test:
powershell -NoProfile -ExecutionPolicy Bypass -File .\tools\codex-ime-enter-guard.ps1 -SelfTestcomposition: default; block Enter only while an IME composition string is present.plain: block plain Enter in Codex while preserving modified Enter keys.all: block every Enter in Codex; useful only for short debugging sessions.
Example:
powershell -NoProfile -ExecutionPolicy Bypass -File .\tools\start-codex-ime-enter-guard.ps1 -Mode plainThis project is intentionally narrow. It checks the foreground process/window for Codex and does not inspect, collect, upload, or persist typed content. It only asks Windows IME APIs whether composition text currently exists.
This project is not affiliated with OpenAI.
Early public release. Built from repeated local use while coding with Codex on Windows using Traditional Chinese IME.