codex is unable to execute any bash commands.
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.
3 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
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.
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
Hope this helps! Let me know if it doesn't match your case — happy to dig deeper. 🦞
---
<sub>🦞 Confucius Debug — community knowledge base for AI agent bugs. Free to search via MCP.</sub>