Skip to content

feat(better-files): a file manager of your own for Show in and the folder menu - #40

Open
nocstah wants to merge 2 commits into
munza:mainfrom
nocstah:better-files-file-manager
Open

nocstah wants to merge 2 commits into
munza:mainfrom
nocstah:better-files-file-manager

Conversation

@nocstah

@nocstah nocstah commented Nov 19, 2026

Copy link
Copy Markdown

Builds on #39 (Linux support), so its first commit is #39's. Only the second commit, 7b8a47e, is new here.

What it adds

A fileManager setting for people whose file manager isn't the platform's: another app, or one their own tooling places, such as a per-workspace file manager.

"settings": { "fileManager": { "name": "Nautilus", "command": ["nautilus", "--select"] } }
  • Show in runs the command with the file's or folder's path after it.
  • The folder menu's Open in runs it with the folder on show.
  • Labels use its name ("Show in Nautilus"), or "file manager" without one.
  • The default, { "name": "", "command": [] }, keeps today's behaviour. So does a command with an empty part.
  • It applies to this computer only. A space on another machine shows no such items, as before.

The right-click menu is a copy of its own that reads no settings, so the sidebar reads the setting and shares it as better-files.file-manager, the same way it shares the editors it finds.

Testing

  • node --test better-files/tests/*.test.cjs: 124 pass. The new tests follow the setting from mod.json to the commands it runs, check that an invalid command falls back to the platform's file manager, and check the labels on each platform. To feed the setting in, the harness's readTextFile now returns a test's own better-files/mod.json text; existing tests are unchanged.
  • node --test better-config/tests/*.test.cjs (schema against DEFAULT_SETTINGS) and node --test site/tests/*.test.cjs pass. node site/build.cjs passes the settings-table check, which fileManager.name and fileManager.command are now in.
  • herdr-app check passes.

🤖 Generated with Claude Code

nocstah and others added 2 commits November 19, 2026 16:17
…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>
…lder menu

A `fileManager` setting, `{ "name": "", "command": [] }` by default, names
a program to use in place of Finder, Explorer or the desktop's file
manager: Show in runs its command with the item's path after it, and the
folder menu's Open in with the folder on show. Labels use its name
("Show in Yazi"), or "file manager" without one. A command with an empty
part, or none, leaves the platform's own.

The sidebar reads the setting and shares it as
`better-files.file-manager`, since the right-click menu is a copy of its
own that reads no settings. Local spaces only, as before.

Tests: the setting from mod.json through to the commands run, invalid
commands falling back, and the labels on each platform. The harness's
readTextFile now returns a test's own better-files/mod.json text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant