You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
desktop: "Open in app" header button opens/copies workspace dir instead of active file; Sublime Text unresolvable on Windows #61678
Desktop "Open in app" header button always opens/copies the workspace directory instead of the active file, and on Windows the Sublime Text entry can't be resolved (openWith: "Sublime Text" fails where, so it falls back to the OS default handler).
Install/channel: latest, installed via ai.opencode.desktop under %LOCALAPPDATA%\Programs
Active plugins: none in ~/.config/opencode/opencode.jsonc
Reproduction
Open any project in the OpenCode desktop app and open a file tab (e.g. board.md).
Click the "Open in" split button at the top right (currently showing the Sublime Text icon).
Observe: the workspace directory (c:\projects\OpenCode) opens in Sublime, not board.md.
Open the same button's dropdown and choose "Copy path": the clipboard gets the directory, not the file.
Expected Behavior
The header "Open in app" button (and its "Copy path" menu item) should target the active file tab's absolute path, falling back to the workspace root only when no file tab is active. "Open in Sublime Text" on Windows should launch subl with the file path.
Actual Behavior
Both actions use screen.file.root (the session directory). Additionally, the Windows app list maps sublime-text to openWith: "Sublime Text"; DesktopFiles.resolveAppPath runs where "Sublime Text", which fails, so FilesOpenPath falls back to shell.openPath (OS default handler) instead of Sublime.
Root cause (from the bundled app.asar, source gui-plugins/src/file/open-in-app.tsx):
OpenInAppButton uses path: () => props.screen.file.root, and screen.file.root is session.directory. Both openPath and copyPath default to input.path().
WINDOWS_OPEN_APPS uses openWith: "Sublime Text" (display name) instead of the subl CLI, unlike the macOS list which correctly uses app bundle names for open -a.
Additional Context
File-level open works correctly elsewhere: the file viewer toolbar uses resolveOpenInAppPath(root, path) and the file tree context menu passes the right-clicked row's path.
Verified against the installed bundle at %LOCALAPPDATA%\Programs\ai.opencode.desktop\resources\app.asar (renderer asset open-in-app-*.js).
Suggested fix: in OpenInAppButton, prefer the active file tab (ctx.layout.stored(session) + layout.state("file:" + id, session) === "active", path via fileTabPath(screen.file, id)), falling back to screen.file.root; and use openWith: "subl" on Windows/Linux.
Reproducible consistently. Workaround: right-click the file in the file tree → "Open in" → Sublime Text.
Thanks for the detailed report and the root-cause analysis. I couldn't reproduce this end to end. It needs OpenCode Desktop on Windows with Sublime Text installed, and my sandbox can't provide that.
The current dev code (8568952) still matches what you describe:
A maintainer with a Windows desktop setup will need to confirm. Until then, your workaround still works: right-click the file in the file tree and use Open in.
Activity
opencodejr commentedon Nov 4, 2026
Thanks for the detailed report and the root-cause analysis. I couldn't reproduce this end to end. It needs OpenCode Desktop on Windows with Sublime Text installed, and my sandbox can't provide that.
The current
devcode (8568952) still matches what you describe:OpenInAppButtoninpackages/gui-plugins/src/file/open-in-app.tsx) passes the workspace root (screen.file.root) to both the launcher and Copy path. It doesn't look at the active file tab. desktop(v2): "Open in" button in side panel header opens workspace root directory instead of the active file tab #55858 already reports this part.openWith: "Sublime Text". On Windows that name is passed towhere, which fails, so the OS default handler opens instead. Desktop: cannot open Sublime Text on Windows #41694 reported the same thing on v1. A fix there (fix(app): use Sublime CLI for open with #41894, switching tosubl) was closed without being merged.A maintainer with a Windows desktop setup will need to confirm. Until then, your workaround still works: right-click the file in the file tree and use Open in.
fix(gui): open the selected file in the header open-in-app actions