Description
Clicking "Open in → PowerShell" in the session header dropdown of OpenCode Desktop on Windows fails with an error toast:
Error invoking remote method 'open-path': Error: Command failed:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
D:\path\to\project
D:\path\to\project : The term 'D:\path\to\project' 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. (CommandNotFoundException)
Root cause (from reading the packaged code): the renderer's Windows "Open in" menu passes openWith: "powershell", which calls platform.openPath(directory, "powershell"). The main-process handler then runs:
execFile("powershell", [path]) // = powershell.exe D:\path\to\project
PowerShell treats the positional argument as a script/command to execute, not a directory to open, so it fails with CommandNotFoundException. This affects any shell (verified with both Windows PowerShell 5.1 and PowerShell 7 / pwsh), so it is broken by design of the open-path handler, not environment-specific.
Expected: "Open in → PowerShell" should open a PowerShell session in the project directory, e.g. spawn powershell/pwsh with -NoExit -WorkingDirectory , or reuse the node-pty shell spawn the app already uses for its built-in terminal panel (which works correctly).
Plugins
None
OpenCode version
OpenCode Desktop 1.18.11 (bundled opencode sidecar)
Steps to reproduce
- Open OpenCode Desktop on Windows and open any project folder
- In the session header, click the "Open in" dropdown
- Select "PowerShell"
- An error toast appears: CommandNotFoundException - the project directory is executed as a command
Screenshot and/or share link
Operating System
Windows 11
Terminal
OpenCode Desktop built-in terminal panel / Windows Terminal
Description
Clicking "Open in → PowerShell" in the session header dropdown of OpenCode Desktop on Windows fails with an error toast:
Error invoking remote method 'open-path': Error: Command failed:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
D:\path\to\project
D:\path\to\project : The term 'D:\path\to\project' 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. (CommandNotFoundException)
Root cause (from reading the packaged code): the renderer's Windows "Open in" menu passes openWith: "powershell", which calls platform.openPath(directory, "powershell"). The main-process handler then runs:
execFile("powershell", [path]) // = powershell.exe D:\path\to\project
PowerShell treats the positional argument as a script/command to execute, not a directory to open, so it fails with CommandNotFoundException. This affects any shell (verified with both Windows PowerShell 5.1 and PowerShell 7 / pwsh), so it is broken by design of the open-path handler, not environment-specific.
Expected: "Open in → PowerShell" should open a PowerShell session in the project directory, e.g. spawn powershell/pwsh with -NoExit -WorkingDirectory , or reuse the node-pty shell spawn the app already uses for its built-in terminal panel (which works correctly).
Plugins
None
OpenCode version
OpenCode Desktop 1.18.11 (bundled opencode sidecar)
Steps to reproduce
Screenshot and/or share link
Operating System
Windows 11
Terminal
OpenCode Desktop built-in terminal panel / Windows Terminal