[Windows Codex CLI] exec_command hangs on trivial PowerShell and cmd.exe commands in both pipe and PTY modes

Open 💬 1 comment Opened Aug 20, 2026 by Seongil-Yoon
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex CLI is running?

codex-cli 0.148.0

What subscription do you have?

Pro

Which model were you using?

gpt-5.6-sol

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What terminal emulator and version are you using (if applicable)?

PowerShell7.6.5

Codex doctor report

Running `codex doctor --json` through exec_command also hangs for more than 30 seconds without returning stdout, stderr, or an exit code. It must be terminated manually.

What issue are you seeing?

Local shell commands invoked through Codex's exec_command runner hang indefinitely, even when the command is trivial.

For example, Get-Content and Write-Output remain in the "Script running" state for more than 30 seconds without returning stdout, stderr, or an exit code. The same
behavior occurs in both pipe and PTY modes.

The problem is not limited to PowerShell. Running an equivalent command through cmd.exe also hangs without producing output.

On the same machine, launching PowerShell directly outside Codex completes in approximately 0.6 seconds. This succeeds both with and without loading the PowerShell
profile.

As a result, Codex cannot reliably inspect files, run Git commands, execute tests, or perform other local development tasks.

The evidence suggests that the failure occurs above the PowerShell layer, possibly in the Codex Windows child-process launcher, sandbox helper, unified exec session, or
process-result handoff path. This is only a working hypothesis; I have not confirmed the exact root cause.

What steps can reproduce the bug?

  1. Open a local workspace in the Codex Windows app.
  2. Ask Codex to run the following command:

Write-Output 'CODEX_EXEC_PROBE'

  1. Wait at least 30 seconds.

Observed result:

  • The command remains in the "Script running" state.
  • No stdout, stderr, or exit code is returned.
  • The execution must be terminated manually.
  1. Repeat the test with a basic file read:

Get-Content -LiteralPath '.\AGENTS.md' -Raw

  1. Repeat it using cmd.exe instead of PowerShell:

cmd.exe /d /c "echo CODEX_CMD_PROBE"

  1. Repeat the tests in both pipe and PTY modes.

All Codex-managed executions hang in the same way.

  1. Outside Codex, launch PowerShell directly with and without the profile.

Both direct executions complete successfully in approximately 0.6 seconds.

### What is the expected behavior?

Trivial local commands should start and finish within a few seconds. Codex should return stdout, stderr, and the process exit code.

If the child process cannot be launched or its result cannot be collected, exec_command should fail promptly with an actionable error instead of remaining in the "Script
running" state indefinitely.

Additional information

Impact: Blocker. Local file inspection, Git operations, builds, tests, and other command-based development workflows are unavailable.

The following possible causes appear unlikely:

  • PowerShell profile: direct execution succeeds both with and without the profile.
  • PowerShell-specific behavior: cmd.exe reproduces the same hang.
  • PTY-specific behavior: both pipe and PTY modes are affected.
  • Large-output backpressure: the issue reproduces with a single short output line.

Fresh thread: [Reproduces / Does not reproduce / Not tested]
After restarting Codex: [Reproduces / Does not reproduce / Not tested]
After rebooting Windows: [Reproduces / Does not reproduce / Not tested]
Codex unsandboxed execution: [Reproduces / Works / Not tested]
Feedback ID: [Paste the ID returned by /feedback, if available]

Possibly related:

View original on GitHub ↗

1 Comment

github-actions[bot] contributor · 8 days ago

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

  • #39517
  • #39484

Powered by Codex Action