Repository navigation
Route shell commands through PowerShell -EncodedCommand to fix paths with spaces - #712
Conversation
linghengqian
left a comment
There was a problem hiding this comment.
CC @Chance-fyi @aooohan @bytemain . Could you help approve the CI run?
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The Windows Lua overrides break existing shell and file-handle contracts and contain incorrect pipe, EOF, and status handling.
Review effort: Balanced
Findings: 1
Open (4)
What changed in this PR
Routes Windows shell execution through PowerShell encoded commands to support paths containing spaces.
Changes:
- Adds shared encoded PowerShell execution helpers.
- Updates junctions, upgrades, shims, and Lua command execution.
- Adds Windows-focused regression tests.
| File | Description |
|---|---|
internal/shared/util/shell.go |
Adds cross-platform shell helpers. |
internal/shared/util/shell_test.go |
Tests command encoding and construction. |
internal/shared/util/file.go |
Creates Windows junctions through PowerShell. |
internal/shared/util/file_windows_test.go |
Tests junction paths containing spaces. |
internal/shared/shim/shim_windows.go |
Escapes paths in generated shims. |
internal/plugin/luai/vm.go |
Installs Windows Lua execution overrides. |
internal/plugin/luai/exec.go |
Implements overridden Lua process APIs. |
internal/plugin/development_output.go |
Uses the shared shell helper in development mode. |
cmd/commands/upgrade.go |
Launches the upgrade script through PowerShell. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Where is CI... I remember there was one before. |
linghengqian
left a comment
There was a problem hiding this comment.
Could you help approve the CI run?
Where is CI... I remember there was one before.
- I’ve opened #713; I will address the review comments on the current PR after that one is merged.
db28236 to
22bb01e
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #712 +/- ##
==========================================
- Coverage 35.09% 35.00% -0.09%
==========================================
Files 92 95 +3
Lines 6514 6702 +188
==========================================
+ Hits 2286 2346 +60
- Misses 3922 4043 +121
- Partials 306 313 +7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
22bb01e to
96f9c8f
Compare
vfox main carries the fix for Windows homes containing a space (version-fox/vfox#712), so its combos now point VFOX_HOME at C:\Users\John Doe\.vfox, the layout from version-fox/vfox-flutter#33. Released builds still fail on such paths, so they keep the unspaced slot home. The plugin only double-quotes Windows paths when they contain whitespace: vfox main passes the command line to cmd.exe verbatim, so the quotes survive, while released builds still re-quote the line and mangle embedded double quotes.
vfox main carries the fix for Windows homes containing a space (version-fox/vfox#712), so its combos now point VFOX_HOME at C:\Users\John Doe\.vfox, the layout from version-fox/vfox-flutter#33. Released builds still fail on such paths, so they keep the unspaced slot home. The plugin only double-quotes Windows paths when they contain whitespace: vfox main passes the command line to cmd.exe verbatim, so the quotes survive, while released builds still re-quote the line and mangle embedded double quotes.
vfox main carries the fix for Windows homes containing a space (version-fox/vfox#712), so its combos now point VFOX_HOME at C:\Users\John Doe\.vfox, the layout from version-fox/vfox-flutter#33. Released builds still fail on such paths, so they keep the unspaced slot home. The plugin only double-quotes Windows paths when they contain whitespace: vfox main passes the command line to cmd.exe verbatim, so the quotes survive, while released builds still re-quote the line and mangle embedded double quotes. Also check the license headers of YAML, TOML, Dockerfiles and ignore files: SkyWalking Eyes already knows their comment style, so they no longer need to be excluded from paths-ignore. go.mod and .gitattributes get hand-written headers because the fixer knows no comment style for them, as does Dockerfile-runner (the fixer only matches the exact name `Dockerfile`). The two Windows Dockerfiles keep `# escape=` on line 1, so their headers sit right below it. go.sum stays ignored: the go tool parses every non-empty line as a hash record.
vfox main carries the fix for Windows homes containing a space (version-fox/vfox#712), so its combos now point VFOX_HOME at C:\Users\John Doe\.vfox, the layout from version-fox/vfox-flutter#33. Released builds still fail on such paths, so they keep the unspaced slot home. The plugin only double-quotes Windows paths when they contain whitespace: vfox main passes the command line to cmd.exe verbatim, so the quotes survive, while released builds still re-quote the line and mangle embedded double quotes. Also check the license headers of YAML, TOML, Dockerfiles and ignore files: SkyWalking Eyes already knows their comment style, so they no longer need to be excluded from paths-ignore. go.mod and .gitattributes get hand-written headers because the fixer knows no comment style for them, as does Dockerfile-runner (the fixer only matches the exact name `Dockerfile`). The two Windows Dockerfiles keep `# escape=` on line 1, so their headers sit right below it. go.sum stays ignored: the go tool parses every non-empty line as a hash record.
The Windows io.popen override added in #712 returns a table with read, write and close only. gopher-lua's file and process handles also expose lines(), so plugin code that iterates command output with `for line in handle:lines()` fails with "attempt to call a non-function object" before reading anything. vfox-python's PostInstall hits this while enumerating its installer packages, which breaks `vfox install python` on Windows. Add a lines() method that returns an iterator backed by the same buffered reader as read("*l"): one line without its trailing CR/LF per call, nil at EOF, and an error on the write-only mode. This restores the contract the override was meant to preserve. Fixes #749 Co-authored-by: jlc <jlc@localhost>



-EncodedCommandto fix paths with spaces.