Skip to content

Windows: spawn [object Promise] ENOENT when switching editor or terminal #26287

@nanami7777777

Description

@nanami7777777

Description

Environment:

  • Windows 11
  • VSCode installed and accessible
  • PowerShell installed and accessible

Issue:
When switching editor or terminal in OpenCode, the following error appears:

Error invoking remote method 'open-path':
Error: spawn [object Promise] ENOENT

This happens when switching to VSCode as well as PowerShell.

Additional info:

  • code --version works correctly in terminal
  • PATH is configured correctly
  • PowerShell can be launched normally outside OpenCode

Observation:
The error message contains:

spawn [object Promise]

which suggests a Promise object may be passed into child_process.spawn() without await.

Possible problematic pattern:

spawn(getExecutablePath())

instead of:

spawn(await getExecutablePath())

So this may be an async handling bug in the editor/terminal switching logic on Windows.

Plugins

no

OpenCode version

OpenCode Desktop v1.14.41

Steps to reproduce

No response

Screenshot and/or share link

Image

Operating System

windows 11

Terminal

powershell

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions