Codex CLI executes commands successfully but stdout/stderr is always empty (exit code 0)

Resolved 💬 5 comments Opened Jan 12, 2026 by Empty0Qc Closed Jan 13, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

v0.80.0

What subscription do you have?

gpt pro

Which model were you using?

gpt-5.2-codex high

What platform is your computer?

macos

What issue are you seeing?

Description

When using Codex CLI, all commands execute successfully (exit code = 0), but stdout and stderr are always empty, including basic commands like echo, pwd, ls, /bin/echo, etc.
This makes the CLI effectively unusable for any task requiring command output.

This issue persists across restarts and appears to be a systemic problem in the runner/output capture layer rather than a user environment issue.

---

Environment

  • Codex CLI version: v0.80.0
  • OS: macOS (Intel Mac, macOS 10.15.7)
  • Shell: zsh / bash (tested both)
  • Project directory: ~/Documents/project/android-assistant
  • Terminal: Web UI + Codex CLI

---

Expected behavior

Commands such as:

echo test
pwd
ls -la
whoami
date

### What steps can reproduce the bug?

### Bug description
Codex CLI executes commands successfully (exit code = 0), but stdout/stderr is always empty.  
This happens for all commands, including basic ones like `echo`, `pwd`, `ls`, `/bin/echo`, etc.  
The issue persists across restarts and appears unrelated to shell config or user environment.

### Steps to reproduce
1. Open Codex CLI (version v0.80.0)
2. Run any of the following commands:
   ```bash
   echo test
   pwd
   ls -la
   whoami
   /bin/echo test
   /bin/ls -la .


### What is the expected behavior?

_No response_

### Additional information

_No response_

View original on GitHub ↗

5 Comments

Empty0Qc · 7 months ago

Thanks for reviewing this. I’d like to add some additional context that may help triage.

I checked existing issues and found similarities with:

  • #7317 (shell commands return empty output)
  • #6033 (shell output invisible to agent)
  • #6991 (missing output from agent commands)

However, my case appears more severe and fully reproducible:

  • stdout is empty for all commands, including:
  • builtins: echo, pwd, printf
  • binaries: /bin/echo, /bin/ls, /bin/pwd
  • stderr is also empty (even with 2>&1 redirection)
  • forcing PTY (script -q ...) has no effect
  • clean shell (env -i bash --noprofile --norc) has no effect
  • writing output to file and reading back with cat still produces no visible output

All commands return exit code 0, which strongly suggests that execution succeeds but the output is lost between the runner and the UI.

This effectively blocks all workflows that rely on shell execution (build, test, git, etc.), so I believe this is a critical usability issue rather than a configuration problem.

If there is any debug mode, logging flag, or runner-level diagnostics I can enable to help investigate further, I’m happy to try it.

补充说明:
该问题并非偶发,而是稳定复现。所有命令执行成功(exit code = 0),但 stdout/stderr 始终为空,且已排除 shell 配置、PTY、权限、环境变量等用户侧因素。
综合判断更可能是 Codex runner 输出捕获链路或前端展示层缺陷。

如有调试参数(debug flag / verbose mode / runner 日志)可开启,我愿意继续配合排查。

Empty0Qc · 7 months ago

Additional context regarding versions (possible regression):

I previously used Codex CLI v0.36 for a long time and never encountered this issue.
The CLI worked reliably and command outputs (stdout/stderr) were always displayed correctly.

I later upgraded directly to v0.72 (skipping intermediate versions between v0.36 and v0.72), and since then this issue has appeared and persisted across newer versions (including v0.80.0).

So far:

  • v0.36 → works correctly (no output issues)
  • v0.72+ → consistently affected by empty stdout/stderr issue
  • I did not use versions between v0.36 and v0.72

This suggests the problem may be a regression introduced somewhere between v0.36 and v0.72.

补充版本信息(可能是回归问题):

我曾长期使用 Codex CLI v0.36,从未遇到 stdout/stderr 无输出的问题,一直表现稳定。
后来直接从 v0.36 升级到了 v0.72(中间版本未使用),从 v0.72 开始该问题持续出现,并在后续版本(包括 v0.80.0)中仍然存在。

目前情况:

  • v0.36 → 完全正常
  • v0.72 及以上 → 稳定复现 stdout/stderr 为空
  • 未测试 v0.36 与 v0.72 之间的版本

因此怀疑这是在 v0.36 ~ v0.72 之间引入的回归问题。

etraut-openai contributor · 7 months ago

This sounds like something that is specific to your system. We haven't heard of other issues like this. It's likely some custom configuration in your shell. You'll probably need to do more diagnosis on your own to determine the underlying problem.

Empty0Qc · 7 months ago
This sounds like something that is specific to your system. We haven't heard of other issues like this. It's likely some custom configuration in your shell. You'll probably need to do more diagnosis on your own to determine the underlying problem.

OK,let me check my shell config, thank your reply~

Empty0Qc · 7 months ago
This sounds like something that is specific to your system. We haven't heard of other issues like this. It's likely some custom configuration in your shell. You'll probably need to do more diagnosis on your own to determine the underlying problem.

After fully resetting and reinstalling my local shell environment (including bash/zsh and related configuration), the issue no longer occurs.
Command output (stdout/stderr) is now displayed correctly again in Codex CLI.

So in my case, the problem was ultimately caused by a corrupted or misconfigured local shell environment rather than Codex itself.

Thanks again for the help and for maintaining the project — much appreciated.