Skip to content

[codex] Add native Windows shell support#41

Draft
yurilopes wants to merge 1 commit into
Waishnav:mainfrom
yurilopes:codex/windows-powershell-shell-support
Draft

[codex] Add native Windows shell support#41
yurilopes wants to merge 1 commit into
Waishnav:mainfrom
yurilopes:codex/windows-powershell-shell-support

Conversation

@yurilopes

Copy link
Copy Markdown

What changed

This PR improves DevSpace shell execution on Windows while preserving the existing Bash behavior for Linux, macOS, and users who explicitly opt into Bash.

  • Adds DEVSPACE_SHELL=auto|bash|powershell|cmd.
  • Uses native PowerShell by default on Windows instead of routing PowerShell commands through Bash/MSYS.
  • Adds native cmd.exe support via DEVSPACE_SHELL=cmd.
  • Keeps Pi's Bash backend for DEVSPACE_SHELL=bash and non-Windows defaults.
  • Adds a PowerShell guardrail that blocks fragile -match usage with raw Windows path literals, including literals assigned to variables and then passed to -match.
  • Updates devspace doctor, MCP tool guidance, docs, and tests.

Why

When ChatGPT generated PowerShell commands through the previous Bash-backed shell, Bash/MSYS could expand PowerShell syntax such as $_.CommandLine before PowerShell received it. Native PowerShell execution fixes that transport issue.

A second common failure mode remained: using PowerShell -match for literal Windows path fragments. -match is regex-based, so path fragments like \profiles can trigger malformed regex escapes such as \p. The new guardrail blocks the fragile pattern and tells the model to use .Contains(), -like, or [regex]::Escape().

Impact

Windows users can run DevSpace with native PowerShell by default. Existing Bash workflows remain available with DEVSPACE_SHELL=bash, and Linux/macOS behavior stays on the existing Bash backend.

Validation

  • npm test
  • npm run typecheck
  • npm run build
  • git diff --check
  • Manual global install and devspace doctor on Windows confirmed Shell mode: auto resolves to native PowerShell.

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: aef558ac-43ef-41b3-9a23-b15551696bba

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant