Skip to content

Desktop: Open in PowerShell fails on Windows — 'open-path' passes project path as a command (CommandNotFoundException) #39851

Closed as not planned

Description

@lu4er

Description

On Windows, right-clicking a project and choosing to open it in PowerShell fails. The desktop app invokes the \open-path\ IPC method, which runs:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe D:\Develop\Docker\cli-proxy-api D:\Develop\Docker\cli-proxy-api

PowerShell then treats the project path as a command to execute, producing:

``
The term 'D:\Develop\Docker\cli-proxy-api' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1

  • D:\Develop\Docker\cli-proxy-api
  •   + CategoryInfo          : ObjectNotFound: (D:\Develop\Docker\cli-proxy-api:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
    

``

Full error dialog: \Error invoking remote method 'open-path': Error: Command failed: ...\

Root cause

The project directory is passed to \powershell.exe\ as a positional argument (twice), instead of using -Command "Set-Location ''", -WorkingDirectory, or spawning with a \cwd\ option. PowerShell interprets the first positional argument as a script/command to run, hence \CommandNotFoundException.

Steps to reproduce

  1. Open a Windows project in OpenCode Desktop (e.g. \D:\Develop\Docker\cli-proxy-api).
  2. Right-click the project (right side panel) and choose to open it in PowerShell.
  3. Observe the failure dialog above.

Expected behavior

A PowerShell window opens with the working directory set to the project folder.

Environment

  • OpenCode Desktop: 1.18.10
  • OS: Windows

Activity

  1. github-actions commented on Jul 31, 2026

    @github-actions
    Contributor

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

    These issues appear to describe the same root cause and symptoms. If the bug is still present in your version despite those being closed, please note that in a comment so maintainers can reopen or track accordingly.

  2. lu4er commented on Jul 31, 2026

    @lu4er
    Author

    The bug is still present in the latest version (v1.18.10, released 2026-07-30). I checked all three referenced issues:

    Reproduction on v1.18.10 (Windows): right-click project -> open in PowerShell -> failure dialog with Error invoking remote method 'open-path' and the project path passed as a positional argument to powershell.exe (twice).

    Suggested fix for maintainers: build the command as powershell.exe -NoExit -Command "Set-Location -LiteralPath '<project path>'", or spawn with a cwd option instead of passing the path as an argument.

    Please keep this issue open / reopen #27636.

  3. hokonoko commented on Sep 2, 2026

    @hokonoko

    Opened a PR for this: #46712 — it uses cmd.exe /c start with a Base64 -EncodedCommand instead of spawn + detached (which doesn't surface a console window on Windows), verified on Windows 11 with project paths containing spaces, single quotes, % chars, and non-ASCII characters.

  4. hokonoko commented on Sep 15, 2026

    @hokonoko

    Still reproducible in OpenCode Desktop v1.18.31 (latest release, published Sep 14) on Windows 11 — "Open in → PowerShell" fails with the same CommandNotFoundException.

    #46712 fixes this.

  5. thdxr commented on Oct 11, 2026

    @thdxr
    Member

    Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

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

Metadata

Metadata

Assignees

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