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 — OpenCode uses Windows PowerShell 5.1 instead of the PowerShell 7 it was launched from · Issue #17372 · anomalyco/opencode

OpenCode uses Windows PowerShell 5.1 instead of the PowerShell 7 it was launched from #17372

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
OpenCode uses Windows PowerShell 5.1 instead of the PowerShell 7 it was launched from#17372
Copy link
Assignees
Hona

Description

@moyaspace
moyaspace
opened on Mar 13, 2026
Issue body actions

Description

Description:
OpenCode is launched from PowerShell 7 (pwsh), but when executing bash commands, it uses C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe (PowerShell 5.1) instead of PowerShell 7.

Impact:
- PowerShell 7 profile is not loaded
- Environment variables, aliases, and functions configured in PowerShell 7 are unavailable
- Developers who have migrated to PowerShell 7 cannot use their familiar configuration

Expected Behavior:
OpenCode should use the same PowerShell version it was launched from, or at least prefer the newer PowerShell version installed on the system.

Environment:

  • Windows
  • PowerShell 7.5.4 installed
  • OpenCode launched from pwsh

Plugins

No response

OpenCode version

1.2.24

Steps to reproduce

  1. Launch OpenCode from PowerShell 7 (pwsh)
  2. Execute a bash command in OpenCode
  3. The command runs in PowerShell 5.1 environment instead

Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

PowerShell 7.5.4 installed

Reacted by Patrick Matthiesen, Zeldris, satoshi_hojo, Ruan Galli, Faisal Afroz and Flemming Steffensen

Activity

  1. moyaspace
    added
    bugSomething isn't working
    on Mar 13, 2026
  2. github-actions
    assigned
    Hona
    on Mar 13, 2026
  3. github-actions
    added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    windows
    on Mar 13, 2026
  4. github-actions commented on Mar 13, 2026

    @github-actions
    github-actionsBot
    on Mar 13, 2026 – with GitHub Actions
    Contributor
    More actions

    This issue might be a duplicate of existing issues. Please check:

    • [FEATURE]:PowerShell (or rather pwsh) support for shell on Windows in OpenCode Desktop #8924: Requests pwsh (PowerShell 7) support as the shell on Windows in OpenCode Desktop
    • [FEATURE]:Run pwsh.exe (my $env:shell) with -NoProfile argument #6703: Requests running pwsh.exe with -NoProfile argument (specifically about OpenCode using pwsh instead of another shell)
    • [FEATURE]:I hope terminal use powershell not cmd in windows os desktop app #15441: Requests using PowerShell instead of cmd in the Windows desktop app
    • [FEATURE]: Shell-aware Bash tool prompt for Windows (Git Bash / cmd.exe / PowerShell) #16479: Feature request for shell-aware Bash tool on Windows (covers PowerShell, Git Bash, and cmd.exe shell selection)

    Please review these issues to see if your report is already covered or if your specific case (bug: using PS 5.1 instead of the PS 7 it was launched from) is distinct enough to warrant a separate issue.

  5. thdxr
    removed
    bugSomething isn't working
    windows
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  6. Mart-Bogdan commented on May 17, 2026

    @Mart-Bogdan
    Mart-Bogdan
    on May 17, 2026
    More actions

    LOL. for me it is in reverse. I've launchef it from 5.1, but OpenCode usese 7.5

  7. kcorax commented on Jun 29, 2026

    @kcorax
    kcorax
    on Jun 29, 2026
    More actions

    It’s very likely that your PATH places Windows PowerShell (powershell.exe) ahead of your modern PowerShell (pwsh.exe) installation. I’ve seen this exact issue on other systems, and the combination of PATH order plus installation type is usually the culprit.

    Winget no longer installs a real standalone package — it redirects you to the Store/MSIX version of PowerShell. That build is sandboxed and relies on shims. Removing it and installing the MSI distribution (explicitly the ~200 MB MSI — not MSIX, not MSIXBundle) consistently fixes the problem.

    The Store/MSIX version installs shims that can launch modern PowerShell, but they do not cover the canonical path: %ProgramFiles%\PowerShell\7\pwsh.exe

    A lot of applications are hardcoded to look exactly there. Notice the executable is pwsh.exe, not powershell.exe. The shims shadow powershell.exe and the powershell alias, but the correct modern binary is always pwsh. Depending on whether you installed via Store or MSI, the alias/executable mapping flips — which is why this feels chaotic.

    Also, don’t worry about updates: the official MSI installation is serviced automatically. On Windows, Windows Update handles it; on other platforms, the runtime’s own updater takes care of it.

    Reacted by XTNGR
  8. kcorax commented on Jun 29, 2026

    @kcorax
    kcorax
    on Jun 29, 2026
    More actions

    Now on the not so relevant issue that was folded into this for whatever reason, about the shell tool being called whatever, I mean, we are still developers. Wrap your powershell in a custom tool and asign it to whichever agent you like. In fact make a new powershell developer agent, plug it with some 7.6 latest changes, give it the miscrosoft learn mcp too (it's actually excellent) and you should be happier than default. Definitely more resilient against context compaction events. Oh and for agent personality all you'll need it "in case a problem arises and you can't solve it by consulting the learn mcp OR in case you fuck up, explain the problem in a concise manner, list the outpup that indicates something went wrong and HALT".

  9. github-actions commented on Aug 28, 2026

    @github-actions
    github-actionsBot
    on Aug 28, 2026 – with GitHub Actions
    Contributor
    More actions

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  10. github-actions
    closed this as not plannedon Aug 28, 2026
  11. Mart-Bogdan commented on Aug 29, 2026

    @Mart-Bogdan
    Mart-Bogdan
    on Aug 29, 2026
    More actions

    Oh my god, WHY???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @Hona
    Hona

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    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.