anomalyco / anomalyco/opencode
Desktop: file:// markdown links are not clickable
@Hona is already working on this.
Since Aug 25, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Summary
In OpenCode Desktop, markdown links to local files (file:///...) render as links (colored/underlined) but do not open on click. The cursor often stays a normal arrow. https:// links work fine.
Environment
- OpenCode Desktop 1.18.18 (macOS)
- Observed across all chat threads
Root cause
Main process only allows http:, https:, and mailto: in resolveExternalURL. Local file:// targets fall through to "blocked external target" and never reach shell.openPath.
There is already a correct path for local files:
resolveLocalFilePath+openLocalFileURL→shell.openPath- IPC
open-local-file/ preloadapi.openLocalFile - Terminal link handler already branches on
protocol === "file:"and callsopenLocalFile
But window navigation policy routes all non-renderer URLs through openExternalURL only:
// setWindowOpenHandler / will-navigate
openExternalURL(url) // file:// blocked here
Markdown <a href="file://..." target="_blank"> therefore opens via setWindowOpenHandler → openExternalURL → blocked.
Suggested fix
In main process, route local files before external open:
function openExternalURL(value) {
if (resolveLocalFilePath(value)) {
openLocalFileURL(value);
return;
}
// existing http(s)/mailto handling
}
Optionally also allow file://localhost/... in resolveLocalFilePath (currently rejects any non-empty hostname).
Workaround for agents
Until fixed: avoid file:// markdown links; give the absolute path as plain text and tell the user to open it from Finder, or run open "/absolute/path".
Notes
A local patch applying the fix above makes file:// links open correctly on Desktop 1.18.18.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.