[Bug] Desktop (Linux): "Desktop IPC handler failed" when opening files with VS Code if `code` is not installed – plus feature request: VSCodium support
Description
Environment
- OpenCode Desktop
@opencode/desktop - Editor: VSCodium installed (
/usr/bin/codiumpresent); VS Code (code) not installed
Description
The Desktop client's "open in" dialog lists "VSCode" as an editor even though
the code binary is not installed on the system. Selecting it results in a
generic error message:
Request failed – Desktop IPC handler failed
Plugins
No response
OpenCode version
v2.2.5 (Electron 44.9.1)
Steps to reproduce
- Linux system with VSCodium installed, but without the
codebinary. - Desktop: toggle session context → "+" (add tab) → "Open file" → select a file.
- In the "open in" dropdown → select VSCode.
Expected: The file opens – or a helpful message appears ("VS Code is not installed").
Actual: Generic IPC error message, no diagnostics, no file opens.
Root cause (source code analysis, branch dev)
-
No existence check on Linux:
packages/desktop/src/files/apps.ts–checkAppExists()unconditionally returnstrueon Linux (existence checking only exists for Windows/macOS). As a result, editors appear in the dropdown that are not installed at all. Related:packages/app/src/runtime/plugin/host-apis.tsx(installed: (app) => platform.checkAppExists?.(app) ?? Promise.resolve(false)). -
Hard-coded Linux mapping entry:
packages/gui-plugins/src/file/open-in-app.tsxmaps on Linuxvscode→ openWithcode. The editor entry itself comes from the fixed listOPEN_APPSinpackages/gui-plugins/src/file/apps.ts(vscode, cursor, zed, textmate, antigravity, finder, terminal, iterm2, ghostty, warp, xcode, android-studio, powershell, sublime-text). -
Error path:
packages/desktop/src/renderer/api.ts(line 58) callsinvoke("FilesOpenPath", { path, application: app });packages/desktop/src/main/files/index.ts(line 126) executesexecFile(application, [target])whenapplicationis set. Withoutcodeinstalled →ENOENT→ the IPC handler throws, and the IPC layer wraps everything as the generic "Desktop IPC handler failed".
Feature requests
- VSCodium editor entry: Add
vscodium(openWithcodium) toOPEN_APPSand the per-OS tables inopen-in-app.tsx. VSCodium is a widely used FOSS alternative without telemetry and belongs in every editor dropdown. - Linux existence check: Actually implement
checkAppExistson Linux (e.g., search thePATHanalogous to Windows/macOS), so that non-installed editors are hidden/disabled in the dropdown. - Better error message: An
ENOENTfromexecFileshould surface as a helpful message in the UI ("Editor 'code' not found") instead of the generic IPC wrapper error.
Workaround (documented)
Wrapper script so the "VSCode" entry opens files in VSCodium:
#!/bin/sh
exec /usr/bin/codium "$@"
(installed as /usr/local/bin/code)
Related issues
- #60013 "Error: Desktop IPC handler failed" (generic wrapper error, various causes)
- #60729 "stale background-service registration causes Desktop IPC handler failed"
- PR #61953 "fix(desktop): drive the IPC port handshake and event stream through state machines"
Screenshot
No response
Operating System
Debian 13 (Linux)
Terminal
OpenCode Desktop
Thanks for the detailed report. I could reproduce this on v2.2.5, and it still happens on the latest dev (52c27fd). I tested the Desktop main-process code directly rather than in the Electron UI.
On Linux with no code on PATH:
checkAppExists("code")returnstrue, as does a made-up editor name. Linux has no installed-check, so the "open in" dropdown lists VSCode even though it isn't installed.- Opening the file then runs
code <file>, which fails withENOENT: Executable not found in $PATH: "code". - The
FilesOpenPathhandler turns that error into a defect, so the UI only shows the generic "Desktop IPC handler failed".
The script below reproduces it. Your wrapper script is a reasonable workaround for now. Adding a VSCodium entry is a separate feature request; #57477 (configurable "Open in" menu with custom editors) is related to it.
Reproduction script (repro.ts)
// Reproduces #63194 at the Desktop main-process level on Linux (Electron UI not run).
// Usage: bun /workspace/repro/repro.ts [path-to-apps.ts] (default: dev's packages/desktop/src/main/files/apps.ts)
import { execFile, execFileSync } from "node:child_process"
import { writeFileSync } from "node:fs"
const { Effect } = await import(Bun.resolveSync("effect", "/workspace/repo/packages/desktop/src"))
const appsPath = process.argv[2] ?? "/workspace/repo/packages/desktop/src/main/files/apps.ts"
const { checkAppExists } = await import(appsPath)
console.log("platform:", process.platform)
let onPath = true
try { execFileSync("which", ["code"]) } catch { onPath = false }
console.log("`code` on PATH:", onPath)
// What the "open in" dropdown asks before listing "VSCode" (openWith "code" on Linux)
const exists = await Effect.runPromise(checkAppExists("code"))
console.log('checkAppExists("code") ->', exists, exists && !onPath ? " <-- BUG: listed although not installed" : "")
console.log('checkAppExists("definitely-not-an-editor") ->', await Effect.runPromise(checkAppExists("definitely-not-an-editor")))
// What DesktopFiles.openPath then runs on non-darwin when an application is set
writeFileSync("/tmp/opencode/file.txt", "hello\n")
await new Promise<void>((resolve) =>
execFile("code", ["/tmp/opencode/file.txt"], (error) => {
console.log("openPath execFile('code', [file]) ->", error ? `${(error as any).code}: ${error.message}` : "ok")
resolve()
}),
)
Run it: bun repro.ts
I'd like to take this one. checkAppExists in packages/desktop/src/main/files/apps.ts returns true on both Linux and Windows without checking, so the same thing happens on Windows: VS Code shows up in "open in" even when it isn't installed. My plan is to check with which on Linux and with the existing where lookup on Windows, and to return a clear "not found" error from the open handler instead of the generic IPC failure. VSCodium support would be a separate PR (it's closer to #57477).
Same failure for Sublime Text on Arch Linux, with the same root cause in the Linux app list.
sublis installed at/usr/bin/subl.- The Linux list (the
qtable inopen-in-app) mapssublime-texttoopenWith: "Sublime Text". That is the macOS app name, not an executable. openPathrunsexecFile("Sublime Text", [file]). Node fails withspawn Sublime Text ENOENT, and the renderer shows the generic "Desktop IPC handler failed".
I confirmed the mapping in the 2.3.0 and 2.3.2 bundles, and reproduced the execFile call directly. I did not click through the UI.
Workaround I use: ln -s /usr/bin/subl ~/.local/bin/"Sublime Text". The desktop app inherits ~/.local/bin from the systemd user PATH.
Suggested fix: use executable names in the Linux list (subl, codium, code, zed, ...), and check PATH in checkAppExists on Linux, so missing editors are hidden and failures show the real error.
Related: #20195 (closed as stale, same Sublime symptom).
Thanks @smnmsr, good find. #63406 now maps Sublime Text to subl in the Linux list and checks PATH on Linux, so missing editors are hidden. Windows was fixed separately in #65320, so I rebased the PR down to Linux only.
Same on Linux desktop 2.4.4, plus the menu shows the macOS Finder icon
Confirmed on an Arch-based Linux box (Hyprland) with the release build. Only code is installed:
$ command -v code cursor zed subl
/usr/bin/code
# cursor, zed, subl: not found
but the "Open in" menu still offers VS Code, Cursor, Zed and Sublime Text, because packages/desktop/src/main/files/apps.ts returns true unconditionally for Linux:
if (process.platform === "linux") return true
Second symptom in the same menu: on Linux the file-manager row reuses the macOS Finder icon. packages/gui-plugins/src/file/open-in-app.tsx:
function fileManagerApp(os: OS) {
if (os === "macos") return { label: "open.finder", icon: "finder" } as const
if (os === "windows") return { label: "open.fileExplorer", icon: "file-explorer" } as const
return { label: "open.fileManager", icon: "finder" } as const // Linux -> macOS Finder icon
}
On Linux this should use a Linux file-manager icon (ideally the icon of xdg-mime query default inode/directory, here io.github.lgse.Strata.desktop); at minimum not the macOS Finder icon — the sprite already has a file-explorer entry that Windows uses.
The menu as rendered here: "文件管理器" with the blue macOS Finder icon (checked), then VS Code, Cursor, Zed, Sublime Text, then "复制路径" — of those editors only VS Code is installed.
Environment:
- desktop 2.4.4 (
~/.local/opt/opencode-desktop-2.4.4/ai.opencode), bundled CLI 2.4.4-x64 - Linux 7.2.15-4-omarchy x86_64, Hyprland,
XDG_CURRENT_DESKTOP=Hyprland - default file manager:
xdg-mime query default inode/directory->io.github.lgse.Strata.desktop - installed editors:
codeonly (cursor,zed,sublabsent)
Related: #20195 (auto-closed stale) — on Linux sublime-text maps openWith to the display name "Sublime Text" instead of subl, so that entry fails even when Sublime Text is installed. A real checkAppExists on Linux would also need per-app executable names like this instead of display names.