Problem
On Windows, Codex hardcodes PowerShell as the agent shell. PowerShell syntax is unfamiliar to the model compared to bash, leading to worse command generation. Users with Git Bash installed have no way to switch.
Proposed Solution
Add a [windows].agent_shell config key ("power-shell" | "git-bash") to ~/.codex/config.toml:
[windows]
agent_shell = "git-bash"
When git-bash is selected:
- Agent default shell resolves to bash (with Git for Windows fallback paths)
- Tool descriptions sent to the model switch to bash syntax examples
- Hard error on session start if bash is configured but not found
- Bash binary registered as sandbox-readable root
Default behavior (PowerShell) is unchanged when the key is omitted.
Implementation
I have a working implementation in my fork with all tests passing:
The implementation follows existing config patterns ([windows].sandbox, [windows].sandbox_private_desktop) and the zsh-fork shell resolution precedent.
Problem
On Windows, Codex hardcodes PowerShell as the agent shell. PowerShell syntax is unfamiliar to the model compared to bash, leading to worse command generation. Users with Git Bash installed have no way to switch.
Proposed Solution
Add a
[windows].agent_shellconfig key ("power-shell"|"git-bash") to~/.codex/config.toml:When
git-bashis selected:Default behavior (PowerShell) is unchanged when the key is omitted.
Implementation
I have a working implementation in my fork with all tests passing:
cargo test -p codex-tools— 59 passed, 0 failedcargo test -p codex-core --lib— 1558 passed, 0 failed from these changesThe implementation follows existing config patterns (
[windows].sandbox,[windows].sandbox_private_desktop) and the zsh-fork shell resolution precedent.