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.
7 Comments
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 interactivePowerShell session without feeding the command, so we only see the startup banner/prompt and exit 0. Same happens for
cmd /c dirbecause it never runs inside that PowerShell session. The fix is probably inthe 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.
Related issue: https://github.com/openai/codex/issues/7649
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!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.cmdcc @sayan-oai @dylan-hurd-oai
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.
Tried to retrace my steps for how
pwsh.cmdended up higher in myPATHthanpwsh.exebut it turns out I never installed Powershell 7+ on this machine. Seems like the only way you get access topwshas opposed to the longerpowershellis 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 😭
Okay, mostly closing this out of embarrassment but just in case anyone else has a similar issue: Removing
pwsh.cmdfrom myPATHfixed the issue, tested on0.64.0,0.65.0,0.66.0Thank you to all the contributors who work on this cli tool, it's really good.