Users have asked for highlighting a selected torrent file/folder in Downloads when using Deluge and I found that xdg-open does not support such an option. Searching around I also found Chromium and other applications are affected so it is needing solved somehow.
On OSX there is a -R option for open which reveals the file/folder in Finder instead of opening and on Windows a '/select,' option exists for explorer.exe
Nautilus now supports such an option if you pass just a filename, although not folders, but it is a starting point and apparently Dolphin has a '--select' option.
fyi, xdg-open is largely just a wrapper for other applications, so can't implement features to available to underlying tools.
I'm not sure xdg-open can know if the underlying tool can support this or not, but i'll see (e.g. like the nautilus case you mentioned)
So now it's 4 years later and both Dolphin and Nautilus definitely support the ability to select a file in a folder:
nautilus -s /path/to/selected_file
dolphin --select /path/to/selected_file
Can we implement the feature in xdg-open? xdg-open can either:
a) Check the underlying tool's version number to make sure it supports selection, and fail with a particular error code if the underlying tool does not. Then the caller can decide on falling back or not.
b) Just attempt to run the underlying tool and see what happens. If the underlying tool reports an error, pass that back up to the caller.
We need that feature, I will handle it. I will give a shot and try to figure it out how to contact authors and send a patch.
Code::Blocks needs this feature, too!
I guess we'll do the hack chromium does, but it is not pretty and it is complex.
So please add this feature.
The best option is to make it opt-in feature for filemanagers. Every filemanager can specify somewhere (if I understand it correctly this place is the desktop file) that it supports selecting and what is the command flag for this.
I'm sure all filemanagers will be updated pretty fast if this goes into the standard.
-- GitLab Migration Automatic Message --
This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.
You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xdg/xdg-utils/issues/58.