Fix Windows shell runtime and PowerShell UTF-8 handling#796
Fix Windows shell runtime and PowerShell UTF-8 handling#796Niche-alchemy wants to merge 5 commits into
Conversation
|
@Niche-alchemy Thanks for the PR. I validated this following the maintainer review process, including git archaeology, targeted runtime tests, and native Windows checks. What this PR is trying to fixThis PR aims to improve Windows shell runtime behavior and PowerShell UTF-8 handling:
Validation performedLinux:
macOS:
Windows:
Failure: I also ran a direct PowerShell UTF-8 e2e through InterpretationThe patch direction is useful, but the current Windows behavior does not prove the core UTF-8 claim yet. The new runtime test also fails in a realistic Windows environment where Git Bash is installed. Requested changesCould you please update this PR with the following?
Once those are updated, this should be re-tested on Windows specifically. |
Summary
pwshover Windows PowerShell 5.1 when Git Bash/POSIX shell is unavailable.ctx_execute(language: "javascript")for portable filtering/counting instead of bash-only shellexamples.
Why
On Windows,
ctx_execute(language: "shell")may run under PowerShell instead of POSIX shell. Bash-style examples such asgrep/head/tailcan silently fail or produce no useful output. PowerShell 5.1 also defaults to non-UTF-8 encodings, which breaks Chinese paths/output.Verification
npm run typecheckvitest run tests/runtime.test.ts -t "Windows prefers pwsh over powershell when bash unavailable"vitest run tests/executor.test.ts -t "buildPowerShellScriptContent prefixes UTF-8 encoding setup"npm run bundlenpm run assert-bundle