Skip to content

[Windows] POSIX path conversion mangles slash-prefixed CLI args under Git Bash #409

Description

@mariohe0007

Summary

On Windows, when the codex-companion runtime is invoked from a Git Bash
(MSYS2) shell, arguments that look like POSIX absolute paths (e.g. a PID
passed as /12345, or flags like /codex:cancel) get auto-translated by
MSYS's path-conversion layer into C:/Program Files/Git/12345, which
breaks the call.

Reproduction

Environment:

  • Windows 10 / 11
  • Git for Windows (MSYS2-based bash)
  • @openai/codex-plugin-cc 1.0.5

Steps:

  1. From Git Bash, start a background Codex job and obtain its job id.
  2. Run /codex:cancel <pid> where <pid> is passed as /12345.
  3. Observe that the call fails — the argument received by the runtime is
    C:/Program Files/Git/12345, not /12345.

Workaround

Set MSYS_NO_PATHCONV=1 in the user's shell profile (~/.bashrc for Git
Bash; $PROFILE for any PowerShell session that may spawn Git Bash
sub-shells). This globally disables MSYS path conversion for the session.

Suggested fix

Either:

  • Have the plugin's wrapper script set MSYS_NO_PATHCONV=1 (or use the
    per-arg MSYS2_ARG_CONV_EXCL=* form) when spawning child processes on
    Windows, scoped narrowly so it does not pollute the parent shell, or
  • Document the requirement explicitly in the README's Windows section.

Happy to send a PR if the maintainers prefer the wrapper-level fix.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions