GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(core): find Microsoft Store PowerShell 7 on Windows by Hona · Pull Request #61952 · anomalyco/opencode

Conversation

@Hona

@Hona Hona commented Nov 5, 2026 •
edited by opencodejr Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

On Windows, OpenCode never picks PowerShell 7 when it comes from the Microsoft Store. The shell tool and terminals fall back to Windows PowerShell 5.1, even with "shell": "pwsh" in config. A configured absolute alias path throws EACCES.

  • Cause: Store apps put an app execution alias (an IO_REPARSE_TAG_APPEXECLINK reparse point) in %LOCALAPPDATA%\Microsoft\WindowsApps. It launches like any .exe, but stat rejects it with EACCES, so which@6 skips it and ShellSelect.executable() throws.
  • Fix: When which finds nothing on Windows, which() looks for an alias on PATH. ShellSelect accepts a rooted alias before it calls stat.
Call lstat stat access Launches
WindowsApps\…\pwsh.exe (Bun 1.4.4 and Node 26) symlink, 85 B EACCES ok 7.6.9
flowchart LR
  A["which('pwsh')"] --> B{which@6}
  B -- "stat EACCES: skipped" --> C["alias on PATH? (lstat symlink + exists)"]
  C -- yes --> D["WindowsApps\…\pwsh.exe"]
  B -- found --> D2[path]
Loading
Shell resolution on a machine with Store PowerShell 7 Before After
Default (no config) powershell.EXE 5.1 pwsh.exe 7
"shell": "pwsh" powershell.EXE 5.1 pwsh.exe 7
"shell": "…\WindowsApps\pwsh.exe" throws EACCES …\WindowsApps\pwsh.exe
  • Spawn: cross-spawn has the same which blind spot, so it still starts the alias through cmd.exe /d /s /c. Its argument escaping keeps %, &, |, ^, <>, ! and quotes intact.
  • Tests: Tests cannot create an app execution alias, so the new cases borrow one from the user's WindowsApps and skip where none exists.

Visual

<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">which pwsh</text>
  <g class="old"><text x="12" y="42" fill="currentColor">PS 5.1</text><text x="12" y="58" fill="currentColor" opacity=".6">alias skipped</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">PS 7.6</text><text x="140" y="58" fill="currentColor" opacity=".6">alias found</text></g>
</svg>

Added by the opencode bot (AI-generated).

Fixes #55255

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Hona
fix(core): find Microsoft Store PowerShell 7 on Windows
e303b12
Copilot AI balanced review requested due to automatic review settings November 5, 2026 05:33
Copilot AI reviewed Nov 5, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for 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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
opencodejr[bot]
opencodejr Bot reviewed Nov 5, 2026
View reviewed changes

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks sound. I couldn't verify it at runtime because the bug needs Windows with PowerShell 7 installed from the Microsoft Store, and the sandbox runs Linux. Reading the code: the new PATH scan in which() only runs on Windows, for bare names, after which@6 finds nothing. In ShellSelect.executable(), the alias check comes before stat, so both the fallback to 5.1 and the EACCES thrown from stat (which #55255 reports crashing the session step) should be gone. The related which and shell tests pass here; the new alias tests are skipped on Linux.

Public API: unchanged. No config keys, CLI flags, SDK or HTTP API changes; it only changes how shells and executables are found on Windows.

No blocking concerns.

Fixes #55255

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Hona Hona mentioned this pull request Nov 5, 2026
exec: Windows commands no longer inherit sshd's SHELL and PROMPT Hona/mesh#1
Merged
@Hona
Hona merged commit b6cfbec into dev Nov 5, 2026
16 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@Hona
Hona deleted the pwsh-store-alias branch November 5, 2026 05:51
@github-actions github-actions Bot mentioned this pull request Nov 5, 2026
📊 AI CLI 工具社区动态日报 2026-11-05 96loveslife/big_model_radar#747
Open
@amrkmn amrkmn mentioned this pull request Nov 7, 2026
opencode 2.2.6 amrkmn/homebrew-tap#1217
Closed
1 task
@github-actions github-actions Bot mentioned this pull request Nov 7, 2026
feat: opencode release v2.2.6 sprisa/opencode-server#84
Merged
@opencodejr opencodejr Bot mentioned this pull request Nov 7, 2026
issue #62501
Open
@Supernatural-cpp Supernatural-cpp mentioned this pull request Nov 7, 2026
v2.2.6 regression: shell tool returns empty output (exit 0) for every command when Store PowerShell 7 resolves to its app-execution alias #62512
Closed
@Hona Hona mentioned this pull request Nov 7, 2026
fix(core): keep multi-line commands intact for Store PowerShell 7 #62522
Merged
@github-actions github-actions Bot mentioned this pull request Nov 7, 2026
Tool release: OpenCode 2 v2.2.6 (was v2.2.5) agent-sh/agnix#1808
Closed
This was referenced Nov 7, 2026
shell: shell executable paths with spaces break all shell tool calls (Windows) #62606
Closed
Shell exits 64 when the Windows pwsh path contains a space #62683
Closed
@jcompagner jcompagner mentioned this pull request Nov 9, 2026
Multi-line shell command runs only the first line on Windows/PowerShell (regression 2.2.5 to 2.2.6) #62877
Closed
@Sniezka1927 Sniezka1927 mentioned this pull request Nov 11, 2026
[Bug]: Shell tool fails on every command when the Windows user folder name contains a space nightly-labs/openbot#6682
Closed
This was referenced Nov 20, 2026
[Bug] Terminal: PowerShell 7 (winget/MSIX) missing from shell list, probeExecutable cannot stat WindowsApps app execution alias (EACCES) openchamber/openchamber#7025
Closed
[Bug] Agent shell still falls back to PowerShell 5.1 with MSIX pwsh on 2.7.3: upstream alias fix (#61952) fails under Electron's Node because existsSync(alias) is false openchamber/openchamber#7278
Open
Windows: pwsh installed as a Store app-execution alias is not resolved, so the shell falls back to Windows PowerShell 5.1 #55255
Closed
@opencodejr opencodejr Bot mentioned this pull request Nov 26, 2026
OpenCode hangs indefinitely; built-in Azure and Shell plugins fail to initialize on Windows ; wrong working directory recognition #66507
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@opencodejr opencodejr[bot] opencodejr[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Windows: pwsh installed as a Store app-execution alias is not resolved, so the shell falls back to Windows PowerShell 5.1

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@Hona
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.