Skip to content

feat: configurable Windows agent shell (powershell/git-bash) #16717

Description

@Jawad-hussain-kalwar

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestwindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions