Skip to content

Windows: exec_command ignores explicit Git Bash path and launches WSL bash instead #60793

Closed

Description

@SilvaNotics

Environment

  • Windows 11
  • Codex desktop: 26.1106.6628.0
  • Bundled CLI: 0.167.0-alpha.4.1
  • Git for Windows: 2.56.0.windows.2
  • WSL installed
  • Desktop configuration:
    • runCodexInWindowsSubsystemForLinux = false
    • integratedTerminalShell = "gitBash"

Steps to reproduce

Call exec_command with:

{
  "shell": "C:\\Program Files\\Git\\bin\\bash.exe",
  "login": false,
  "cmd": "uname -s; pwd"
}

Expected

Execute the specified Git Bash binary and report MINGW64.

Actual

Executes WSL bash and reports Linux, with the working directory under /mnt/.

Directly invoking the same Git Bash executable from PowerShell correctly reports MINGW64. Both login modes reproduce the issue.

Suspected cause

The upstream get_shell_by_model_provided_path implementation uses the provided path only to identify the shell type, then discovers its executable again through PATH. On this machine, that resolves to C:\Windows\System32\bash.exe, the WSL launcher.

Suggested fix

Honor an explicitly supplied absolute executable path. If it cannot be executed, return an error instead of silently choosing another executable and execution environment.

Activity

  1. added
    bug
    app
    windows-os
    tool-calls
    on Nov 11, 2026
  2. github-actions commented on Nov 11, 2026

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

  3. SilvaNotics commented on Nov 11, 2026

    @SilvaNotics
    Author

    Related to #60573, but this report provides a reproducible Git Bash → WSL case and a suspected executable-path resolution issue. The symptoms may share a root cause, but that has not been confirmed. Keeping this open pending maintainer triage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appbugtool-callswindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions