xdg-open should use xdg-mime instead of run-mailcap when no DE detected
Bug #220765 reported by
John Carlyle-Clarke
This bug affects 8 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Xdg-utils |
Fix Released
|
Medium
|
|||
xdg-utils (Ubuntu) |
Fix Released
|
Low
|
Unassigned |
Bug Description
Binary package hint: xdg-utils
xdg-utils 1.0.1-2 on Ubuntu Gutsy
When no desktop environment is detected, xdg-open falls back to a generic mechanism based on run-mailcap. This is rather limited as it depends on file extensions. It would seem better to use file or probably xdg-mime to choose how to open the file.
The mime type could be fetched with:
file --mime "$1"
and extracted from the output and prepended to the filename before passing to run-mailcap.
However, it looks to me like a better option would be to use xdg-mime, since xdg-mime query default "$1" will give you the default application to open the file.
Changed in xdg-utils: | |
status: | Unknown → In Progress |
Changed in xdg-utils: | |
status: | In Progress → Fix Released |
Changed in xdg-utils: | |
importance: | Unknown → Medium |
Changed in xdg-utils: | |
importance: | Medium → Unknown |
Changed in xdg-utils: | |
importance: | Unknown → Medium |
To post a comment you must log in.
xdg-open is broken on Ubuntu, and the suggested change would not improve it.
The whole idea of having xdg-utils is to have a uniform utility that works the same on all distributions.
Now xdg-open honors the BROWSER environment variable, but Ubuntu patches it to use run-mailcap instead, thus introducing two important differences between distributions.
If a utility needs a browser and asks vanilla xdg-open it will get one. But on Ubuntu the patched xdg-open may give some random utility such as
html2text. This means that Ubuntu breaks all such utilities.