Skip to content

Cmd+click on local file paths opens wrong URL (http instead of file://) #19144

Closed
jecruz/opencode
#1

Description

@jecruz

Bug Description
When cmd+clicking on a local file path (e.g., README.md, src/app.ts) in a chat message, OpenCode tries to open it as an HTTP URL instead of a local file.

Steps to Reproduce

  1. Have a project open in OpenCode Desktop
  2. Send/receive a message containing a local file path like README.md
  3. Cmd+click on the file path
  4. See error: "Unable to connect. Is the computer able to access the URL?"

Expected Behavior
Local file paths should open using the file:// scheme, which opens the file in the default application (e.g., mkdn for .md files).

Root Cause
In packages/desktop-electron/src/main/ipc.ts, the open-link handler passes bare file paths directly to shell.openExternal(), which treats them as HTTP URLs.

Fix
Convert bare file paths (those without a scheme like http://, file://, etc.) to file:// URLs with resolved absolute paths before calling shell.openExternal().

Testing

  • Verified that clicking README.md now opens in the default markdown viewer (mkdn)
  • Verified that file://, https://, and other schemes still work correctly

Activity

  1. added a commit that references this issue on Mar 25, 2026
    8f0f049
  2. Meligy commented on Jul 4, 2026

    @Meligy

    Looks like this issue was closed by mistake because of merging a PR in the fork. The issue is still present in: Version 1.17.13 (1.17.13)

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

Metadata

Metadata

Assignees

Labels

webRelates to opencode on web / desktop

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions