CLI Shell Output Missing on Windows 11

Resolved 💬 7 comments Opened Dec 8, 2025 by YoungPhlo Closed Dec 9, 2025
💡 Likely answer: A maintainer (sayan-oai, contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

codex-cli 0.65.0

What subscription do you have?

ChatGPT Plus

Which model were you using?

gpt-5.1-codex-max

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What issue are you seeing?

  • Running any shell command in Codex CLI on Windows only returns the PowerShell banner and prompt—no actual command output—while exit code is 0.
  • Repro (from C:\Users\STREAM\code\research\temp):
  • Get-ChildItem → only shows banner + PS C:\Users\STREAM\code\research\temp> prompt, no listing.
  • Get-Location → same (no path printed).
  • cmd /c dir, cmd /c cd, or even echo test → same result.
  • Expected: normal stdout from these commands (directory listing, current path, echoed text).
  • Environment: Windows, shell is PowerShell (invoked per command by CLI), sandbox_mode workspace-write, approval_policy on-request, network_access restricted. No virtualenv activated.

What steps can reproduce the bug?

Uploaded thread: 019afeb3-fbda-7852-9abc-83d72613398e

What is the expected behavior?

For shell commands to work.

Additional information

I think this behavior started around the time I upgraded from 0.64.0 to 0.65.0 and downgrading did not fix.

View original on GitHub ↗

7 Comments

YoungPhlo · 7 months ago

I asked Codex how we got here:

---

User

If you had to guess what the problem is what would it be?

Codex

Likeliest culprit: the Codex CLI isn’t actually passing the command to PowerShell. On Windows, PowerShell needs -Command "<cmd>" (or an equivalent stdin pipe) but the harness seems to start an interactive
PowerShell session without feeding the command, so we only see the startup banner/prompt and exit 0. Same happens for cmd /c dir because it never runs inside that PowerShell session. The fix is probably in
the Windows shell runner: ensure commands are invoked via powershell.exe -Command "<user command>" (and respect workdir), rather than just launching PowerShell with no command.

---

I want to clone the codebase and let it debug so bad 😭 but I'd have to switch machines to macOS to do it and then it can't repro.

YoungPhlo · 7 months ago
sayan-oai contributor · 7 months ago

Hey @YoungPhlo, would you mind sharing the content of your C:\Users\<user>\.local\bin\pwsh.cmd? I think this will help us understand why your powershell commands are running interactively. Thanks!

YoungPhlo · 7 months ago

oof, thats terrible. i totally i forgot i created that trying to be clever about getting to powershell faster when i remote into my machine. it might be affecting this.

here it is:
pwsh.cmd

@echo off
powershell

cc @sayan-oai @dylan-hurd-oai

YoungPhlo · 7 months ago

i'm just realizing i broke the Cursor agent harness this way too omg 😂 this has been wreaking havoc on my machine and i did not know it. thank you for pointing it out.

YoungPhlo · 7 months ago

Tried to retrace my steps for how pwsh.cmd ended up higher in my PATH than pwsh.exe but it turns out I never installed Powershell 7+ on this machine. Seems like the only way you get access to pwsh as opposed to the longer powershell is installing Powershell 7 or better. It doesn't come default on Windows 11.

Anyways, if you need a beta tester for everything that could possibly go wrong running Codex on a Windows machine give me a ring 😭

YoungPhlo · 7 months ago

Okay, mostly closing this out of embarrassment but just in case anyone else has a similar issue: Removing pwsh.cmd from my PATH fixed the issue, tested on 0.64.0, 0.65.0, 0.66.0

Thank you to all the contributors who work on this cli tool, it's really good.