[VOTE needed] configurable Windows agent shell (powershell/git-bash) #16717
What variant of Codex are you using?
cli
What feature would you like to see?
configurable Windows agent shell (powershell/git-bash) #16717
provide your vote!
Additional information
No response
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
- #16717
Powered by Codex Action
claude code is not opensourced, but git-bash is supported on windows
+1 on this. Concrete use case from a Windows-native project, winuxsh (https://github.com/unixwin/winuxsh): a bash/zsh-like shell for Windows built on rubash + winuxcmd, intended for both humans and coding agents. The non-interactive -c contract is already agent-friendly (clean stdout/stderr, no banner, exact exit-code propagation, native Windows paths, ~ = %USERPROFILE%). The only thing standing between winuxsh and Codex shell_command is exactly what this issue proposes — a configurable Windows shell path.
I verified by tracing through codex-rs/shell-command/src/shell_detect.rs and codex-rs/core/src/session/session.rs that on Windows Codex currently hardcodes get_shell(ShellType::PowerShell, None) and reads no env var or config.toml field. The field proposed in #16579 (windows.shell_path) is exactly the missing piece; as soon as it lands, winuxsh can be wired up with a single config line.
Please coordinate with #16579 — the implementation there already covers config parsing, profile override, executable validation, and schema regeneration. Landing either approach unblocks the entire alternative Windows shell ecosystem, not just Git Bash.
+1. On Windows, the agent defaults to PowerShell which causes frequent syntax errors and wasted tokens when the model generates bash-style commands. The integratedTerminalShell setting in the UI is misleading — it only affects the integrated terminal, not the agent shell. Having [windows].agent_shell in config.toml would be a huge improvement for Windows users with Git Bash installed.
Source-level confirmation of this request (codex-cli 0.154.0, Windows 11 26200):
codex-rs/shell-command/src/shell_detect.rs:default_user_shell_from_path()returnsget_shell(ShellType::PowerShell)on Windows, andget_user_shell_path()returnsNoneon non-Unix — so neither an env var nor a config key can change the agent's default shell today.codex-rs/core/src/tools/handlers/unified_exec/exec_command.rs: the shell is the model-providedshellargument, elsesession.user_shell()(that PowerShell default).codex-rs/config/src/config_toml.rs/types.rs: onlyshell_environment_policyandallow_login_shellexist; there is no shell selector.
What works today: steering the model with an instruction like "pass shell: \"bash\" unless the task is Windows-specific". With Git for Windows bash on PATH (D:\Git\usr\bin\bash.exe here), the per-call parameter resolves to bash and commands run normally (verified end to end).
What still blocks a usable default even if the key lands: #15016 (with the Windows sandbox enabled, shell: "bash" fails with "couldn't create signal pipe, Win32 error 5") and #40328 (Desktop embedded CLI falling back to cmd.exe for an explicit bash shell).
+1 for [windows].agent_shell = "git-bash", as prototyped in #16717.
I want my codex run on linux to use powershell