Windows PowerShell: Codex should quote paths containing parentheses like Next.js app/(main)

Open 💬 4 comments Opened May 8, 2026 by jhseo-tec

Codex CLI sometimes generates shell commands on Windows PowerShell with unquoted paths that contain parentheses, such as Next.js route group paths:

rg test iPlantMES/apps/web/app/(main)/admin -S

In PowerShell, (main) is not treated as a literal path segment. It is parsed as an expression/command token. On Windows, main resolves to:

C:\Windows\System32\main.cpl

So this can unexpectedly open the Mouse Properties control panel, or split the path incorrectly.

Environment:

  • Codex CLI: 0.129.0
  • OS: Windows
  • Shell: Windows PowerShell 5.1.26100.8115
  • Node: v22.14.0
  • Project type: Next.js app router with route group folder (main)

Reproduction:

  1. In a Windows PowerShell environment, use a project path containing app/(main)/admin.
  2. Ask Codex to inspect/search files under that path.
  3. Codex may emit a command like:

rg test iPlantMES/apps/web/app/(main)/admin -S

  1. PowerShell parses (main) instead of treating it as a literal path.

Observed:

  • The path is split incorrectly.
  • In some cases Windows opens Mouse Properties via main.cpl.

Expected:
Codex should quote or escape paths containing PowerShell metacharacters, for example:

rg test 'iPlantMES/apps/web/app/(main)/admin' -S

or otherwise use safe path passing on Windows PowerShell.

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗