Arguments to Exec program in terminal-based desktop entries are improperly escaped
Version information
Thunar 4.20.1, NixOS
Steps to reproduce
- Create a file named
foo.desktop
in one of the search locations for desktop entries, with the following contents (vim
can be replaced with any other terminal-based text editor):
[Desktop Entry]
Name=foo
Exec=vim %F
Terminal=true
Type=Application
- Create a file named
a b
anywhere. - Open
a b
in Thunar withfoo
.
Current behavior
Vim is called with the two arguments path/to/a
and b
.
Expected outcome
It should be called with the single argument path/to/a b
.
Additional information
The Exec key in the desktop entry specification.
Since this doesn't happen for desktop entries without Terminal=true
, my guess is that Terminal=true
causes Thunar to interpret the Exec
key as a shell command rather than in the format described by the desktop entry specification; hence in this case the key is incorrectly interpreted as the command vim path/to/a b
instead of the list of arguments ["vim", "path/to/a b"]
.