Codex CLI gets stuck with no welcome message and broken keyboard shortcuts

Resolved 💬 12 comments Opened Sep 7, 2025 by andhikadk Closed Nov 28, 2025
💡 Likely answer: A maintainer (aibrahim-oai, contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

codex-cli 0.30.0

Which model were you using?

gpt-5

What platform is your computer?

Microsoft Windows NT 10.0.26100.0 x64

What steps can reproduce the bug?

  1. Run codex from terminal.
  2. Normally, a welcome message appears, but in this case nothing shows up.
  3. The CLI appears stuck in this state.
  4. Keyboard shortcuts stop working properly (e.g., Backspace inserts a space, exit shortcuts don’t work).

What is the expected behavior?

  • Codex CLI should show the standard welcome message after running codex.
  • Keyboard shortcuts (Backspace, Ctrl+C, etc.) should function normally.
  • The user should be able to exit the session cleanly.

What do you see instead?

  • No welcome message.
  • CLI stuck in an unresponsive mode.
  • Backspace becomes Space.
  • Exit shortcuts don’t work, so I can’t quit normally.

<img width="722" height="210" alt="Image" src="https://github.com/user-attachments/assets/72d4a105-a874-4b39-a04c-99d55770be51" />

Instead of responding to arrow keys, the CLI outputs raw escape sequences:
<img width="637" height="165" alt="Image" src="https://github.com/user-attachments/assets/081fdc75-e871-4e09-834c-7df67a71e568" />

Additional information

Issue happens randomly, not always.
Restarting the terminal doesn’t fix it.
Reinstalling Codex CLI also doesn’t solve the problem.
I also experienced this bug in a previous version of Codex CLI.

View original on GitHub ↗

12 Comments

aibrahim-oai contributor · 10 months ago

Is there a clean repro way? this will help a lot.

abushadab · 10 months ago

I had a similar issue! The problem was permission-related - Codex couldn't create session files due to directory ownership issues.

Quick fix to try:
sudo chown -R $USER:$USER ~/.codex/sessions/

What to check:

  • Look at ~/.codex/log/codex-tui.log for "Permission denied" errors
  • Check if ~/.codex/sessions/ directories have correct ownership

This happens when session directories get created with root permissions, preventing Codex from writing rollout files. The ownership fix usually resolves the stuck startup and keyboard issues.

andhikadk · 10 months ago
Is there a clean repro way? this will help a lot.

I don’t have a clean reproducible way yet — the issue happens randomly.
Sometimes codex starts normally, other times it gets stuck (screenshot above). Restarting the terminal doesn’t help, reinstalling CLI also doesn’t help.

The only thing that consistently fixes it (at least temporarily) is restarting Windows.

I’ll keep monitoring to see if I can find a consistent trigger.

andhikadk · 10 months ago
I had a similar issue! The problem was permission-related - Codex couldn't create session files due to directory ownership issues. Quick fix to try: sudo chown -R $USER:$USER ~/.codex/sessions/ What to check: Look at ~/.codex/log/codex-tui.log for "Permission denied" errors Check if ~/.codex/sessions/ directories have correct ownership This happens when session directories get created with root permissions, preventing Codex from writing rollout files. The ownership fix usually resolves the stuck startup and keyboard issues.

Thanks for the tip! I do see a .codex folder on Windows as well. The CLI isn’t stuck right now, but if the bug happens again I’ll check the log/codex-tui.log and try looking into the sessions directory permissions. Will update here if I find anything.

yuzixuan0722 · 10 months ago

I encountered the same issue in the Windows environment, but in my case this problem occurs consistently. The codex-tui.log shows no exception logs at all - it doesn't even output any logs. Only when I rolled back the codex version to 0.22.0 did it work normally.

StithyStudios · 10 months ago

I have the same issue with verison 0.34.0. Successfully logged in using subscription plan, no welcome message, Ctrl-C don't work, I should write prompts, on Enter is no response and I can write another prompt. /status shows no tokens send or received. Downgrade to 0.22.0 helps

bolinfest collaborator · 10 months ago

Do either of you have MCP servers, by chance?

andhikadk · 10 months ago
Do either of you have MCP servers, by chance?

I don't use mcp server

yuzixuan0722 · 10 months ago
Do either of you have MCP servers, by chance?

I didn't use MCP either

yuzixuan0722 · 10 months ago

The latest version 0.36.0 is working again

StithyStudios · 10 months ago

0.36.0 has the same issue for me, but I have resolved the issue!

As suggested in another thread with the same problem (affecting both CLI and the Codex extension for VS Code), I disabled the execution of bash.exe via the Windows security policy (gpedit).

After doing this, Codex CLI now uses powershell and works perfectly – no more issues with being stuck or broken keyboard shortcuts.

etraut-openai contributor · 7 months ago

I think this issue has been fixed in recent versions, so I'm going to close it. If you see similar problems with the latest version of the CLI, please open a fresh bug report and provide repro details.