Windows crash when pressing Enter with Chinese Pinyin IME at line-wrap boundary
Summary
On Windows, Codex crashes when pressing Enter while an uncommitted Chinese Pinyin IME composition is positioned exactly at the automatic line-wrap boundary in the input box. The console host then exits, which makes the PowerShell window appear to flash and close.
Environment
- Codex CLI:
0.147.0 - Codex executable:
C:\Users\Administrator\AppData\Local\Programs\OpenAI\Codex\bin\codex.exe - Windows PowerShell:
5.1.20348.4163 - Windows build:
10.0.20348.4163 - Console host: legacy
conhost.exe - Input method: Chinese Pinyin IME
- UI language/locale: Chinese
Steps to reproduce
- Open Codex on Windows from PowerShell.
- Enable a Chinese Pinyin IME.
- Type in the Codex prompt until the text exceeds one visual line.
- Arrange for the final cell of the first visual line to contain an active/uncommitted Pinyin composition.
- Press Enter.
- Codex and the console host crash, and the PowerShell window closes.
Boundary behavior
- Reproduces when the active Pinyin composition is exactly at the end of the wrapped visual line.
- If two additional Chinese characters are entered so the cursor has already moved to the next visual line, pressing Enter does not crash.
- Committing the IME composition before pressing Enter also avoids the crash.
Windows Event Viewer evidence
The failure has reproduced multiple times with the same signatures:
conhost.exe: exception code0xc0000005, offset0x000000000006cb08codex.exe: BEX64 / exception code0xc0000409, parameter0000000000000007powershell.exe:System.ComponentModel.Win32ExceptioninSystem.Management.Automation.Host, involvingConsoleControl.GetConsoleScreenBufferInfo
Example occurrence: 2026-08-08 around 05:51–05:54 local time (Asia/Shanghai).
Expected behavior
Enter should commit/submit the prompt without crashing, regardless of the IME composition state or visual wrap position.
Additional notes
The observed order and error signatures suggest an interaction among Codex input rendering, Chinese IME composition handling, and the Windows console screen buffer at an exact wrap boundary. No crash dump is attached because it may contain sensitive process memory.