xdg-open does not spawn terminal for Terminal=true
Submitted by Thomas Gläßle
Assigned to Portland Bugs
Description
Created attachment 118945 Ad hoc patch to launch terminal
xdg-open does not spawn terminals for desktop files with Terminal=true
.
For example consider the following configuration:
~/.local/share/applications/ranger.desktop
:
[Desktop Entry]
Name=ranger
Type=Application
Terminal=true
Exec=ranger %F
~/.local/share/applications/mimeapps.list
:
[Default Applications]
inode/directory=ranger.desktop
inode/mount-point=ranger.desktop
Then I expect ranger to be opened in a terminal upon running:
xdg-open /
What currently happens is:
(a) if running the command from a non-terminal context, xdg-open tries to execute ranger without terminal. This errors and xdg-open falls back to execute mimeopen which ignores mimeapps.list and only looks at defaults.list and therefore confusingly may use another default.
(b) if running the command within a terminal, ranger is opened in the current terminal. While this is fine, I think it would be fine as well to spawn a new terminal.
This applies to xdg-utils 1.1.1.
The attached patch spawns a new terminal asynchronously indiscriminately of case (a) versus case (b). It uses the TERMINAL environment variable, similar to what mimeopen
does.
Attachment 118945, "Ad hoc patch to launch terminal":
spawn_terminal.diff
Version: 1.1.0