GeezerVison is showing github.com — fix(desktop): list only installed apps in Open in on Linux by Anthony14FR · Pull Request #63406 · anomalyco/opencode
Conversation
Anthony14FR
commented
Nov 11, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Issue for this PR
Closes #63194
Type of change
- Bug fix
- New feature
- Refactor / code improvement
- Documentation
What does this PR do?
checkAppExists returned true on Linux without checking anything, so "Open in" listed editors that aren't installed, and picking one failed with "Desktop IPC handler failed".
Linux launches openWith as a bare command, so an app is now listed only if that command is an executable file on PATH. The lookup reads PATH directly instead of running which, since minimal distros don't ship it.
The Linux list also mapped Sublime Text to "Sublime Text", the macOS app name, which is not a command on Linux. It now uses subl, as @smnmsr found in the issue.
Windows was fixed separately by #65320, so I rebased this PR down to Linux only.
How did you verify your code works?
- Added a Linux case to
apps.test.ts: an executable subl on PATH is found, a non-executable file and a missing command are not. It fails on dev, where Linux always reports true.
bun test src/main/files/apps.test.ts in packages/desktop and oxlint pass on Windows 10, where the Linux case is skipped. I couldn't run it on Linux myself.
Screenshots / recordings
No visible UI change beyond missing editors disappearing from the "Open in" menu.
Checklist
- I have tested my changes locally
- I have not included unrelated changes in this PR
Added by the opencode bot (AI-generated).
Related: #57477
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix works on Linux. I ran the #63194 reproduction against the base and this PR, calling checkAppExists directly. On the base, code and a made-up editor name both report as installed. With this PR they report false, while sh still reports true. The new test passes here and fails on the base, as it should. I couldn't check the Windows path or the Electron UI.
Public API is unchanged: this only touches Desktop's main-process app detection.
One point worth addressing, left as an inline comment: on Linux, detection now depends on the which command being installed.
Related: #57477
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
return paths[0] ?? null
|
|
|
})
|
|
|
|
|
|
function isOnPath(appName: string) {
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Linux, whether an app counts as installed now depends on the which command existing. Some minimal setups (Arch base, slim Fedora images) don't ship it. There execFile("which") fails with ENOENT, which reads as "not installed" for every app, so the menu would go from listing every editor to listing none. Looking the name up in process.env.PATH directly (split on path.delimiter, then check each candidate with fs.access(..., X_OK)) would avoid the extra process and that dependency. macOS could keep using which as its fallback.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, thanks. Fixed in 3f1c2d8: Linux now looks the command up in PATH directly (regular file + X_OK), so it no longer needs which. macOS keeps which as its fallback. I also added a test row for a non-executable file on PATH; it runs on Linux and macOS only, since Windows has no execute bit.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My earlier concern is fixed. Linux now searches PATH itself and only counts runnable regular files, so it no longer needs the which command. macOS still falls back to which as before. I found no other problems in the new commit.
I ran the #63194 reproduction against the base and this PR, calling checkAppExists directly. On the base, code and a made-up editor name both report as installed. With this PR they report false, and sh still reports true. That also held with PATH limited to a folder that holds only a link to sh, so no which was available. The test file (3 cases) and tsc -b pass. I couldn't check Windows or the Electron UI.
Public API is unchanged.
Related: #57477
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Anthony14FR
changed the title
fix(desktop): only list installed editors in "Open in" on Linux and Windows
fix(desktop): list only installed apps in Open in on Linux
Nov 22, 2026
This branch has not been deployed
No deployments
Reviewers
Hona
Awaiting requested review from Hona
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|