Skip to content

Fix shell command win - #3253

Closed
zheli1119 wants to merge 9 commits into
openai:mainfrom
zheli1119:fix-shell-command-win
Closed

zheli1119 wants to merge 9 commits into
openai:mainfrom
zheli1119:fix-shell-command-win

Conversation

@zheli1119

Copy link
Copy Markdown
  1. Enforce the use of PowerShell commands on Windows, minimizing reliance on Linux commands.
  2. Wrap Command in script blocks to prevent syntax errors or truncation caused by outer shell parsing.
  3. Fixed frequent failures when using codex on Windows due to Linux command or syntax incompatibility, improving overall compatibility and stability.

…and-issues

Fix PowerShell -Command quoting
1. Enforce the use of PowerShell commands on Windows, minimizing reliance on Linux commands.
2. Wrap `Command` in script blocks to prevent syntax errors or truncation caused by outer shell parsing.
3. Fixed frequent failures when using codex on Windows due to Linux command or syntax incompatibility, improving overall compatibility and stability.
@zheli1119

Copy link
Copy Markdown
Author

recheck

@zheli1119 zheli1119 left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolve merge conflicts; further boost the weighting for choosing pwsh on Windows.

@Nonary

Nonary commented Sep 9, 2025

Copy link
Copy Markdown

Side note: If you install MSYS2 the bash commands will work as expected and function just as good as running it on Linux.

@zheli1119

Copy link
Copy Markdown
Author

Side note: If you install MSYS2 the bash commands will work as expected and function just as good as running it on Linux.

I agree with this, but why not get it right from the very beginning? Or at least remind users at the start to install XXX for a better experience. I think many users will feel quite frustrated by these errors, and the overall impression is not very friendly.

@Nonary

Nonary commented Sep 9, 2025

Copy link
Copy Markdown

Side note: If you install MSYS2 the bash commands will work as expected and function just as good as running it on Linux.

I agree with this, but why not get it right from the very beginning? Or at least remind users at the start to install XXX for a better experience. I think many users will feel quite frustrated by these errors, and the overall impression is not very friendly.

That is the problem though, these fixes do not actually properly add windows support. It is noticeably much slower and less effective when it uses any other shell than bash.

To truly add windows support, requires a lot more rework than this basically. And I agree it should be at least documented in some way. But for now the best way is either WSL or MSYS2

@Nonary

Nonary commented Sep 14, 2025

Copy link
Copy Markdown

Created a quick guide on Show and Tell for configuring bash on windows for Codex using MSY2 as a workaround right now if people want to know how: #3580

@etraut-openai

Copy link
Copy Markdown
Contributor

Thanks for the contribution, and apologies for the slow response. We've received many PRs, and we don't have the bandwidth on the codex team to review all of them.

I suspect this PR is likely no longer relevant. We've made many changes recently to improve behavior on Windows, and those overlap the changes in this PR.

If you think that there are remaining bugs that have not been addressed, let us know.

@github-actions github-actions Bot locked and limited conversation to collaborators Oct 30, 2025
@openai openai unlocked this conversation Oct 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants