Repository navigation
Conversation
…anager On Linux, `window().platform` is "linux", which fell through to the macOS commands: `mdfind` isn't there, so Open in never offered an editor, and Open in default app, Show in Finder and the folder menu ran `open`, which isn't there either, and failed. - Editors: each built-in editor gets `bins`, its commands on Linux (`zeditor`/`zed`, `code`/`code-oss`, `cursor`, `windsurf`, `subl`). One `sh` run looks them up on PATH, first found wins, and emits the same name\0path\0 pairs as the Windows probe; the path is run with the file. Extra editors with `bins` are looked up too. - Open in default app: `gio open`, which returns once the app starts. Without gio, `xdg-open` under `setsid -f`, since on desktops it doesn't know (Hyprland, Sway) it runs the app in the foreground until it closes. - Show in file manager: org.freedesktop.FileManager1.ShowItems over `dbus-send` (Nautilus, Dolphin, Nemo and others), with the URI percent-encoded so a comma can't split the array; with no file manager answering, the folder opens instead. - Labels say "file manager" on Linux. macOS and Windows commands are unchanged, and their byte-for-byte tests still pass. Tests run the Linux scripts for real against stand-in programs on a PATH of their own, so they pass on macOS too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nocstah
marked this pull request as ready for review
November 19, 2026 09:26
This was referenced Nov 19, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What's wrong on Linux
window().platformis"linux"there, and everything that isn't Windows takes the macOS commands:mdfindisn't installed, so Open in never offers an editor.open, which isn't installed either. They show for a local space and fail when clicked.What this changes
All of it goes through
files/shell.js, like the Windows support in #32. The macOS and Windows commands are unchanged, and their byte-for-byte tests still pass.bins, its commands on Linux:zeditor/zed(Arch ships both, Zed's own installerzed),code/code-oss,cursor,windsurf,subl. Oneshrun looks them up onPATH, first found wins, and prints the samename\0path\0pairs as the Windows probe, sofindEditorsstays as it is. Only an absolute path counts, and only plain command names are passed. The path it found is run with the file. An extra editor insettings.editorswithbinsis looked up too.gio open, which returns once the app has started. Without gio,xdg-openruns undersetsid -f. On a desktop xdg-open doesn't know (Hyprland, Sway…) it runs the app in the foreground until it closes, which would outlastexec's 30-second timeout.org.freedesktop.FileManager1.ShowItemsoverdbus-send, which Nautilus, Dolphin, Nemo and others answer. Thefile://URI encodes every part, sincedbus-sendsplits an array at commas. If no file manager answers, the folder opens instead.Testing
node --test better-files/tests/*.test.cjs: 121 pass, 10 of them new. The new tests run the Linux scripts for real against stand-in programs on aPATHof their own, so they also pass on macOS. Thesetsidone skips wheresetsidis missing.node --test site/tests/*.test.cjspasses.herdr-app checkpasses./usr/bin/zeditor. Against the real session bus,dbus-sendaccepts theShowItemsarguments, and Nautilus providesShowItems(as, s).Notes
mod.schema.jsondescribeseditorsas an array of strings (macOS app IDs), while the README and code use objects (bundle,exe, nowbins). I left the schema as it is.mod.json's version, so you can choose it.🤖 Generated with Claude Code