GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||
GeezerVison is showing github.com — fix(core): keep multi-line commands intact for Store PowerShell 7 by Hona · Pull Request #62522 · anomalyco/opencode Conversation
|
| Command (session shell API) | Before | After |
|---|---|---|
pwd |
✅ path | ✅ path |
UTF-8 setup line \n pwd (what the plugin sends) |
❌ exit=0 size=0 |
✅ path |
echo one \n echo two |
❌ one |
✅ one two |
parent process of pwsh |
cmd |
opencode |
cross-spawn-spawner.test.ts runs a two-line command through the borrowed Store pwsh.exe alias and expects both lines. Without the fix it receives only one. It is skipped where Store PowerShell 7 is not installed, as the tests from fix(core): find Microsoft Store PowerShell 7 on Windows #61952 are.<svg xmlns="http://www.w3.org/2000/svg" width="240" height="72" viewBox="0 0 240 72" fill="none" font-family="ui-monospace, monospace" font-size="11"> <style> .old { animation: old 4s infinite; } .new { animation: new 4s infinite; } @keyframes old { 0%, 40% { opacity: .9 } 50%, 100% { opacity: .15 } } @keyframes new { 0%, 40% { opacity: .15 } 50%, 100% { opacity: .9 } } @media (prefers-reduced-motion: reduce) { .old, .new { animation: none } .old { opacity: .15 } .new { opacity: .9 } } </style> <rect x="0.5" y="0.5" width="239" height="71" stroke="currentColor" stroke-opacity=".3"/> <text x="12" y="22" fill="currentColor" opacity=".6">echo one; echo two</text> <g class="old"><text x="12" y="42" fill="currentColor">one</text><text x="12" y="58" fill="currentColor" opacity=".4">(lost)</text></g> <path d="M100 46 h28 m-6 -5 l6 5 l-6 5" stroke="currentColor" stroke-opacity=".5"/> <g class="new"><text x="140" y="42" fill="currentColor">one</text><text x="140" y="58" fill="currentColor">two</text></g> </svg>
Fixes #62512
Added by the opencode bot (AI-generated).
Related: #62501
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I couldn't run this end to end: it needs Windows with Store-only PowerShell 7, and the sandbox is Linux. From reading the code, the fix matches the cause described in #62512. Launching the link target directly means cross-spawn no longer falls back to cmd.exe /d /s /c, so commands keep every line. Reading the target on each spawn also avoids the stale-path problem from #56381. The spawner tests pass here, with the new test skipped as expected. typecheck:tsc passes for packages/util and packages/core.
Public API: unchanged.
One concern: on Windows the new code follows every symlinked absolute command, not only app execution aliases (see the inline comment).
Related: #62501
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| // reparse point that stat rejects with EACCES. cross-spawn then cannot find it and runs it through | ||
| // `cmd.exe /d /s /c`, which drops everything after the first newline of the command line. Launch the target of | ||
| // the link instead, read on every spawn because a Store update moves it. | ||
| const executable = (file: string) => { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
On Windows this follows any symlinked absolute command, not only app execution aliases. A regular symlink already stats fine, so cross-spawn never fell back to cmd.exe for it. Now it gets launched under its target's name. That changes behaviour for multi-call binaries that pick their behaviour from the name they're started with, such as busybox-w32 applet symlinks. Could this be narrowed to the case being fixed, for example only when stat fails (EACCES) or when the path is under Microsoft\WindowsApps? Ordinary symlinks would then launch exactly as before.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
v2.2.6 regression: shell tool returns empty output (exit 0) for every command when Store PowerShell 7 resolves to its app-execution alias
There was an error while loading. Please reload this page.