Skip to content

fix: Keep dynamic code valid in Windows PowerShell 5.1#1827

Merged
hatayama merged 2 commits into
v3-betafrom
fix/powershell51-argv-escaping
Jul 18, 2026
Merged

fix: Keep dynamic code valid in Windows PowerShell 5.1#1827
hatayama merged 2 commits into
v3-betafrom
fix/powershell51-argv-escaping

Conversation

@hatayama

@hatayama hatayama commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • Windows PowerShell 5.1 now preserves escaped C# quotation marks when it invokes native uloop commands.
  • Existing Windows paths and trailing backslashes retain their intended values.

User Impact

  • Multiline dynamic C# code containing escaped quotes no longer fails with CS1009 under Windows PowerShell 5.1.
  • PowerShell 7 behavior remains unchanged.

Changes

  • Apply the Windows argv backslash rules in the three Windows E2E script entry points.
  • Add a Windows PowerShell regression test for escaped quotes, trailing backslashes, Windows paths, and Japanese text; run it in Windows CI.
  • The Save-EventLog C# string-literal escaping is intentionally unchanged because it is not process argv encoding.

Verification

  • PowerShell 5.1 and pwsh 7 regression script passed.
  • Multiline execute-dynamic-code passed through both hosts using the repo-local Windows CLI.
  • Release-automation workflow tests passed.

Review in cubic

Encode backslashes according to Windows argv rules so existing escaped C# quotes remain valid while ordinary Windows paths are preserved. Add a Windows PowerShell regression test and run it in CI to keep the three E2E scripts synchronized.
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 120eb9f9-5ad4-4e67-8d45-21f026eda53c

📥 Commits

Reviewing files that changed from the base of the PR and between 4ace5b4 and 914a710.

⛔ Files ignored due to path filters (4)
  • Assets/Tests/Demo/scripts/verify-replay-via-cli.ps1 is excluded by none and included by none
  • scripts/run-windows-e2e.ps1 is excluded by none and included by none
  • scripts/test-powershell51-native-argument-escaping.ps1 is excluded by none and included by none
  • scripts/test-simulate-mouse-demo.ps1 is excluded by none and included by none
📒 Files selected for processing (1)
  • .github/workflows/build-and-test.yml

📝 Walkthrough

Walkthrough

The Windows CI workflow now preloads additional verification scripts and adds a dedicated PowerShell 5.1 native argument escaping test step.

Changes

Windows PowerShell CI

Layer / File(s) Summary
PowerShell script loading and validation
.github/workflows/build-and-test.yml
The Windows workflow preloads additional E2E, demo, CLI replay, and argument escaping scripts, then runs the PowerShell 5.1 native argument escaping test.

Estimated code review effort: 2 (Simple) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly reflects the main change: preserving valid dynamic code in Windows PowerShell 5.1.
Description check ✅ Passed The description is detailed and directly matches the Windows PowerShell 5.1 argument-handling and regression test changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/powershell51-argv-escaping

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Only double a trailing backslash when Windows PowerShell will quote an argument, and use the absolute regex end anchor so a final line feed is not treated as the string end. Cover the three regressions and verify actual child-process argument delivery.
@hatayama
hatayama merged commit 81933de into v3-beta Jul 18, 2026
9 checks passed
@hatayama
hatayama deleted the fix/powershell51-argv-escaping branch July 18, 2026 00:41
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