codex-cli 0.114.0 on Windows exits back to PowerShell during normal interactive use
Environment
- OS: Windows
- Shell: PowerShell (also reproduced with
powershell -NoProfile) - Terminal: Windows Terminal
- Codex CLI:
codex-cli 0.114.0 - Install method: npm global (
C:\Users\gflip\AppData\Roaming\npm\codex) - Node: v24.11.0
Config (~/.codex/config.toml)
[windows]
sandbox = "unelevated"
What happens
codex launches normally and responds to simple prompts, then exits unexpectedly back to PowerShell during normal interactive use. There is leftover TUI/status text after exit (e.g. gpt-5.4 low · 100% left · ~ remains on screen), which suggests terminal cleanup is not completing cleanly.
Example session:
hi→ worksare u good?→ worksare u stable?→ works- next prompt (e.g.
no crash,write a python function) → Codex exits, returns toPS C:\Users\gflip>
What was already ruled out
- Not a PowerShell profile issue — reproduced with
powershell -NoProfile - Not a PATH conflict — confirmed single npm install resolves first
- Not a missing binary —
codex --versionprints cleanly, nativecodex.exeruns fine standalone - Reinstalling via npm did not fix it
- Elevated sandbox was a separate compounding issue — config previously had
sandbox = "elevated", which caused early exits. Switching tounelevatedimproved behavior but crashes still occur. - No panics or errors in
~/.codex/log/codex-tui.log— log ends cleanly atcodex_core::codex: closewith no preceding error
Log evidence
The log ends with a completed response turn and then:
codex_core::tasks: close time.busy=20.7ms time.idle=3.19s
codex_core::codex: close time.busy=695µs time.idle=3.83s
No panic, no error — suggesting the exit is intentional from the binary side, possibly triggered by a Windows-specific condition.
Repro steps
- Open
powershell -NoProfile - Run
codex - Send a few chat prompts:
hi,are u good?,are u stable? - Send one more prompt (any)
- Codex exits back to shell unexpectedly
Expected behavior
Codex remains interactive across multiple prompts and does not terminate unless explicitly exited (Ctrl+C or /exit).
Actual behavior
Codex exits to shell unpredictably, typically after 2–4 prompts. Leftover TUI text remains in the terminal after exit.
Additional context
Gemini CLI shows similar instability on the same machine, while Anthropic's Claude CLI is stable. This may point to a Windows terminal / ConPTY / process-handling interaction affecting some interactive CLIs, but Codex should not exit silently regardless.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗