t3code icon indicating copy to clipboard operation
t3code copied to clipboard

[Bug]: Reveal in Files does not select linked files on Linux

Open AksharP5 opened this issue 2 months ago • 3 comments

On Omarchy, choosing Reveal in Files for a linked local file opens the containing folder without selecting the file. In a large directory, the user still has to find the linked file manually.

Steps to reproduce

  1. Use a local Linux environment with a file manager that supports file selection, such as Flea.
  2. Open a conversation containing a link to an existing local file.
  3. Right-click the link and choose Reveal in Files.

Expected: open the containing folder with the linked file selected. Fall back to opening the folder if selection is unsupported.

Actual: only the containing folder opens.

Investigation

The Linux launcher always passes the parent directory to xdg-open. It never attempts the standard org.freedesktop.FileManager1.ShowItems request, even when the file manager supports it. The checked Omarchy installation has Flea registered for that interface.

Confirmed at the process boundary using upstream main and an isolated session bus: the existing launcher invokes xdg-open <parent>, while Flea's installed D-Bus service accepts the full file URI and forwards it as flea --select <file>. The GUI launch was replaced with an argument recorder for this check; no automated desktop UI reproduction is claimed.

AksharP5 avatar Sep 28 '26 04:09 AksharP5

Triage

Confirmed on d15210cd3. Reveal in Files on Linux opens the containing folder and does not select the file.

resolveFileManagerRevealLaunch always returns xdg-open with the parent directory for a normal Linux session:

https://github.com/pingdotgg/t3code/blob/d15210cd3/apps/server/src/process/externalLauncher.ts#L673-L676

The WSLg path that falls back to the Linux file manager does the same thing (xdg-open of the parent, around line 660). macOS still uses open -R, and Windows and WSL Explorer still use /select. The launcher test "reveals by opening the containing directory on Linux" asserts this.

The comment there is about CLI flags. The portable API is the session-bus method org.freedesktop.FileManager1.ShowItems (https://freedesktop.org/wiki/Specifications/file-manager-interface/): the file manager selects that URI in its parent folder. Nautilus, Dolphin, Nemo, Caja, Thunar, and Flea implement it. Folder-only reveal shipped on purpose in #7140; this is that gap, and there is no earlier issue for it.

A fix should call ShowItems with a file URI, and keep today's xdg-open <parent> launch when the helper or the bus name is missing, the call fails, or it does not return. A systemd or SSH server often has no graphical session bus. Finder and Explorer reveals should stay on their current commands.

The process-boundary check in the report matches the source: the launcher never asks the file manager to select the file. #14044 is the open fix for this.

juliusmarminge avatar Sep 28 '26 04:09 juliusmarminge

It's not just Linux, the same thing happens on Windows

armiiin-jp avatar Sep 28 '26 08:09 armiiin-jp

It's not just Linux, the same thing happens on Windows

yeah, there are Windows issues already created, so this one is focused on Linux, but thanks for sharing!

AksharP5 avatar Sep 28 '26 15:09 AksharP5