Repository navigation
Description
Description
When viewing an open file tab in the right side panel in OpenCode Desktop v2 and clicking the Open in split button (e.g. Open in Zed / VS Code / Cursor) in the side-panel tab strip header, OpenCode only focuses/opens the workspace root directory in the target editor instead of opening the file currently viewed in the active tab.
For example, with Zed selected as the target app on macOS:
- Clicking the Open in Zed button in the side-panel header while viewing a file tab switches focus to Zed (opening or focusing the workspace root folder) without opening the file shown in the tab.
- If the file tab was opened from a link to a file outside the workspace root (or if the workspace is already open in Zed), Zed simply comes to the foreground and the file is never opened.
- Likewise, choosing Copy path from that same dropdown copies the workspace root directory rather than the active file tab's path.
- Additionally, right-clicking a file in the right-hand file tree sidebar (
#file-tree-panel/session.panel.sidebar) or right-clicking the file tab itself does nothing because neither is wrapped inOpenInAppContextMenuV2.
Root cause
-
Header
OpenInAppButtonhardcodesprops.screen.file.root:
Inpackages/gui-extensions/src/file/renderer.tsx(lines 405–416),OpenInAppButtonis mounted in thesession.panel.endslot at the right end of the side-panel tab strip (right next to the open file tabs). However, inpackages/gui-extensions/src/file/open-in-app.tsx(lines 189–193),OpenInAppButtonhardcodespathtoprops.screen.file.root(the workspace root directory):export default function OpenInAppButton(props: { session: MountedSession; screen: SessionScreen }) { const ctx = useExtension() const directory = () => props.screen.file.root const state = useOpenInApp({ session: props.session, path: directory, request: useShared().request })
It ignores the active file tab in the side panel (and the active file in
ReviewPanel) and always passesprops.screen.file.roottodesktop.launch(target, openWith)(open -a Zed <workspace-root>). -
Missing context menu on the
session.panel.sidebarfile tree and file tabs:packages/gui-extensions/src/file/sidebar.tsx(mounted atsession.panel.sidebarin#file-tree-panel) renders<FileTree>frompackages/gui-extensions/src/file/tree.tsx(lines 436–483), which does not wrap file nodes inOpenInAppContextMenuV2(unlikeFileTreeV2inpackages/gui-extensions/src/file/tree-v2.tsxline 312, which is only inside the collapsed inner sidebar ofSessionFilePanelV2).- File tab triggers (
PanelTriggerinpackages/app/src/runtime/extension/panel-trigger.tsx) also have no context menu.
Expected behavior
- When a file tab is active in the side panel (or a file is active in the review panel), clicking the Open in button (or Copy path) in the side-panel header should target the active file's resolved path (
resolveOpenInAppPath(props.screen.file.root, activeFilePath)), falling back toprops.screen.file.rootonly when no file tab is active. - Right-clicking files in
FileSidebar(tree.tsx) and/or file tabs should also expose theOpenInAppContextMenuV2menu.
Plugins
None
OpenCode version
2.0.28 (OpenCode Desktop v2)
Steps to reproduce
- Open a project/session in OpenCode Desktop v2 on macOS.
- Open any file in the right side panel (e.g. by clicking a file link in a chat message or opening a file from the file tree so it opens as a tab in the side panel).
- Select Zed (or another editor) in the Open in split button at the top-right of the side-panel tab strip and click the button.
- Observe that macOS switches focus to Zed (
open -a Zed <workspace-root>), but the file currently open in the side-panel tab is not opened in Zed. - Right-click the file tab or a file in the right-hand file tree sidebar (
#file-tree-panel) — no context menu appears.
Screenshot and/or share link
No response
Operating System
macOS 26.6.2 (arm64)
Terminal
OpenCode Desktop App v2
Activity
opencode-agent commentedon Oct 15, 2026
Thanks for the detailed report! I couldn't run this end to end: it needs OpenCode Desktop on macOS with an external editor installed, and my sandbox can't provide that.
The code does match what you describe. In both v2.0.28 and the latest
dev(412b2b1), the side-panel header'sOpenInAppButton(packages/gui-extensions/src/file/open-in-app.tsx) always passes the workspace root (screen.file.root) to the launcher and to Copy path. It never looks at the active file tab. The file tree and file list context menus useresolveOpenInAppPathfor the selected file instead.A maintainer with a macOS Desktop setup will need to confirm this and decide whether the header button should follow the active tab. Until then, the file tree's context menu is a workaround for opening a specific file in your editor.