codex is unable to execute any bash commands.

Open 💬 3 comments Opened Dec 17, 2025 by sooo66
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

codex-cli 0.73.0

What subscription do you have?

gpt plus

Which model were you using?

gpt-5.1-codex-max

What platform is your computer?

Linux 5.4.0-124-generic x86_64 x86_64

What issue are you seeing?

Codex works fine for chatting and conversations, but executing any command (such as pwd, echo, etc.) produces no output. This is true for both the VS Code plugin and the Codex CLI.

This bug appeared suddenly; I was initially using Codex normally.

<img width="642" height="405" alt="Image" src="https://github.com/user-attachments/assets/1c8703b4-1f57-4646-a574-f79bfc1e331b" />

<img width="1097" height="617" alt="Image" src="https://github.com/user-attachments/assets/4f11c10e-2ecc-4a91-8d49-f2f185411ef4" />

What steps can reproduce the bug?

one session id: 019b2b2b-88c6-73d1-a506-3756471c980a

What is the expected behavior?

_No response_

Additional information

I don't know exactly what happened, but I was able to use Codex normally at first, including the VS Code plugin and the Codex CLI.

But suddenly, Codex stopped executing any commands.

View original on GitHub ↗

3 Comments

github-actions[bot] contributor · 8 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #7933
  • #6991
  • #7410

Powered by Codex Action

kana-lab · 8 months ago

In my case, the cause was that the shell Codex created was launched as a login shell.
So telling "When you execute a shell command, launch shell with login:false flag" to Codex resolved this issue.

sstklen · 6 months ago

Hey! I ran into a similar pattern in our bug knowledge base and thought this might help.

What's happening: Codex spawns the child shell as a login shell, which on some Linux configs sources .profile/.bash_profile that redirect stdout, block on interactive prompts, or reset the environment — causing command execution to hang or produce no output while chat (which doesn't spawn a shell) works fine.

What worked for us:

Add 'When you execute a shell command, launch shell with login:false flag' to your Codex system prompt or AGENTS.md. Alternatively, audit your ~/.bash_profile and ~/.profile for commands that block on non-interactive login shells (e.g., mesg, stty, or conditional prompts without proper tty checks). Wrap any interactive-only logic in: if [ -t 0 ]; then ... fi

# In your AGENTS.md or Codex system prompt, add:
When you execute a shell command, always use login:false flag.

# OR fix your ~/.bash_profile — wrap interactive-only commands:
if [ -t 0 ]; then
  mesg n 2>/dev/null
  # other interactive-only setup
fi

Hope this helps! Let me know if it doesn't match your case — happy to dig deeper. 🦞

_Disclosure: This analysis is from Confucius Debug, an AI-powered community KB for agent bugs. Please verify before applying._

---
<sub>🦞 Confucius Debug — community knowledge base for AI agent bugs. Free to search via MCP.</sub>