What version of Codex is running?
codex-cli 0.69.0
What subscription do you have?
Pro
Which model were you using?
gpt-5.1-codex-max (reasoning xhigh, summaries auto)
What platform is your computer?
Linux 6.6.87.2-microsoft-standard-WSL2 x86_64 x86_64
What issue are you seeing?
In WSL you can run dotnet.exe and pwsh.exe, or even powershell.exe and it works quite well. I can run it manually without issues.
However when I added instructions for codex to stop using dotnet, but use dotnet.exe and similar it keeps trying and every time says in the end:
Build: WSL dotnet.exe invocations hang here; please run pwsh.exe -NoLogo -NoProfile -Command "dotnet.exe build TestimoX.sln -c Debug" on Windows to verify. If anything else pops up, I’ll fix it.
I attempted a targeted build from WSL; dotnet.exe hung, so I killed the process. Please run pwsh.exe -NoLogo -NoProfile -Command "dotnet.exe build TestimoX.sln -c Debug" on Windows to confirm everything is clean. If anything else pops up, I’ll fix it.
I tried pushing it multiple times, telling it to wait for timeouts, extending timeouts, doing other tries and I have seen it fight in different sessions across different projects a lot of times finally giving up.
For me support for this would be god send, as I prefer WSL for development and I can see codex feeling much better in there then on Windows, but when I found out that you can actually run dotnet.exe in it, I was amazed and disappointed at the same time that codex keeps failing at it.
What steps can reproduce the bug?
Tell codex to run any .exe under WSL, and watch how it struggles to resolve it, most likely because something is not properly displayed to it
• I'm verifying if the Windows-style executable path is accessible via WSL’s mounted drives to prepare for running the executable from the Linux environment.
• The executable is a .NET 10 Windows exe that should run directly from WSL2 via Windows path or mounted path; the plan is to run it once and capture its output carefully.
◦ Running /mnt/c/Support/GitHub/TestimoX/TestimoX.Monitoring/bin/Debug/net10.0-windows/TestimoX.Monitoring.exe --once
• The command outputs a cursor position report escape sequence, so I'll poll the session by writing empty input to read its output properly.
• I'm weighing how to detect if the process is hung—checking CPU usage or waiting an additional 10 seconds before sending Ctrl+C to terminate.
• Considering waiting an additional 10 seconds to allow the process to complete naturally since it may be slow or timer-based, but also weighing if sending Enter or interrupting could reveal output
sooner.
• I'm preparing to inspect the running process with a system command to determine if it's active or stuck, aiming to decide next steps like sending termination signals or collecting logs.
• Ran ps -p 25796 -o pid,etime,cmd
• I'll poll the session to confirm if it ended despite the process showing as terminated, since the session might still be active or closing asynchronously.
• The running process likely sent an escape sequence querying cursor position and is now waiting for the terminal reply, which may not be delivered in this execution environment; sending a newline
to the process could prompt output and unblock it.
• I'm sending Ctrl+C to safely interrupt the potentially hung process and try to capture any partial output.
• The process appears unresponsive to standard termination signals and may ignore inputs; it's likely running indefinitely without console output. I'll recommend informing the user about the ongoing
• I'm preparing to use taskkill.exe from WSL to forcibly terminate any running TestimoX.Monitoring.exe processes to avoid duplicates before starting a new one. Next, I'll verify process existence
with tasklist.exe | grep before killing.
• Ran /mnt/c/Windows/System32/tasklist.exe | grep TestimoX.Monitoring
└ grep: (standard input): binary file matches
• I'm adjusting the tasklist query to use a filtered command that targets the specific process by name, avoiding binary output issues caused by CRLF characters.
• The escape sequence ESC[6n likely originates from the pseudo-tty environment or exec harness querying the cursor position, not from the command itself; this suggests the output capture is mixing
terminal control queries with actual command output, possibly due to PTY handling or environment configurations affecting output flushing and capture.
• Exploring why Windows commands hang without output inside WSL, considering issues like path encoding, console attachment, and stdout capture; planning to test a simple Windows command to isolate
the problem.
• Running /mnt/c/Windows/System32/cmd.exe /c "echo hello"
• Noticed that ESC[6n output likely comes from a harness or shell handshake querying cursor position, not from the Windows binary itself. This hints the environment might be WSL or a similar setup
where the terminal sends this escape during pseudo-tty initialization, explaining the unexpected hang with Windows executables.
• The environment likely isn't true WSL despite having /mnt/c, since Windows exe calls hang and cmd.exe doesn't respond; this suggests missing WSL integration or a non-WSL Linux setup with a mounted
• Ran file /mnt/c/Windows/System32/cmd.exe
└ /mnt/c/Windows/System32/cmd.exe: PE32+ executable (console) x86-64, for MS Windows, 8 sections
• The output likely comes from the shell's prompt or line editing triggering a cursor position query, not the Windows command itself; this suggests the command may not have run or output was masked
by the interactive shell environment.
• Ran echo hi
└ hi
• The escape code output likely stems from running Windows executables under WSL’s compatibility layer, possibly due to blocking calls like ReadConsoleInputW waiting for input. The process may hang
because the Windows console host isn’t properly reachable, causing indefinite waits despite commands like cmd.exe /c echo hi expected to exit quickly. Next, testing wine availability might clarify
alternative exe execution options.
• Ran which wine
└ (no output)
• I'm checking if Windows executables can run in the current environment by attempting to launch cmd.exe with a short timeout to observe behavior and exit codes.
• Ran timeout 5s /mnt/c/Windows/System32/cmd.exe /c "echo hello from cmd"; printf 'exit code: %s\n' "$?"
└ '\\wsl.localhost\Ubuntu\home\przemyslawklys'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
hello from cmd
exit code: 0
• I concluded the earlier control character output likely stemmed from PTY allocation and not quoting issues. To avoid UNC path complications, I'll run the Windows exe from a /mnt/c/... working
directory with a 30s timeout and ensure the command uses correct quoting and path formats.
◦ Running cd /mnt/c/Support/GitHub/TestimoX/TestimoX.Monitoring/bin/Debug/net10.0-windows && timeout 30s ./TestimoX.Monitoring.exe --once
• The executable likely outputs ESC[6n and hangs waiting for input, as adding a timeout helped when it wasn’t hanging; I'll wait longer on that session to confirm if output appears.
• The process uses a 30-second timeout to avoid indefinite hanging, so I'll wait the remaining time to see if it completes within that limit.
• Ran cd /mnt/c/Support/GitHub/TestimoX/TestimoX.Monitoring/bin/Debug/net10.0-windows && timeout 30s ./TestimoX.Monitoring.exe --once
└ (no output)
• The command timed out after 30 seconds with exit code 124 and produced no output, indicating it likely hung or ran too long; next, I'll propose reporting this to the user with the command and exit
code, offer longer time or logging, and plan to kill lingering processes to prevent runaway.
• I'm re-running the tasklist command with a timeout to quickly verify if the specific process is active.
• Ran timeout 5s /mnt/c/Windows/System32/tasklist.exe /FI "IMAGENAME eq TestimoX.Monitoring.exe"
└ (no output)
■ Conversation interrupted - tell the model what to do differently. Something went wrong? Hit `/feedback` to report the issue.
What is the expected behavior?
When I run it manually (takes 1 second)
przemyslawklys@EVOMONSTER:~$ /mnt/c/Support/GitHub/TestimoX/TestimoX.Monitoring/bin/Debug/net10.0-windows/TestimoX.Monitoring.exe --once
Report written to: C:\Support\GitHub\TestimoX\TestimoX.Monitoring\bin\Debug\net10.0-windows\monitoring-report.html
przemyslawklys@EVOMONSTER:~$
Additional information
For me this is super important and would solve my issue watching codex struggle with PowerShell on Windows. I would start using it occasionally so i could do less manual runs for it, but then
I see it struggling with powershell edits. Having WSL run .exe would be amazing.
What version of Codex is running?
codex-cli 0.69.0
What subscription do you have?
Pro
Which model were you using?
gpt-5.1-codex-max (reasoning xhigh, summaries auto)
What platform is your computer?
Linux 6.6.87.2-microsoft-standard-WSL2 x86_64 x86_64
What issue are you seeing?
In WSL you can run dotnet.exe and pwsh.exe, or even powershell.exe and it works quite well. I can run it manually without issues.
However when I added instructions for codex to stop using dotnet, but use dotnet.exe and similar it keeps trying and every time says in the end:
Build: WSL dotnet.exe invocations hang here; please run pwsh.exe -NoLogo -NoProfile -Command "dotnet.exe build TestimoX.sln -c Debug" on Windows to verify. If anything else pops up, I’ll fix it.I attempted a targeted build from WSL; dotnet.exe hung, so I killed the process. Please run pwsh.exe -NoLogo -NoProfile -Command "dotnet.exe build TestimoX.sln -c Debug" on Windows to confirm everything is clean. If anything else pops up, I’ll fix it.I tried pushing it multiple times, telling it to wait for timeouts, extending timeouts, doing other tries and I have seen it fight in different sessions across different projects a lot of times finally giving up.
For me support for this would be god send, as I prefer WSL for development and I can see codex feeling much better in there then on Windows, but when I found out that you can actually run dotnet.exe in it, I was amazed and disappointed at the same time that codex keeps failing at it.
What steps can reproduce the bug?
Tell codex to run any .exe under WSL, and watch how it struggles to resolve it, most likely because something is not properly displayed to it
What is the expected behavior?
When I run it manually (takes 1 second)
Additional information
For me this is super important and would solve my issue watching codex struggle with PowerShell on Windows. I would start using it occasionally so i could do less manual runs for it, but then
I see it struggling with powershell edits. Having WSL run .exe would be amazing.