Control: reassign -1 mailcap 3.70 On Thu, 25 Nov 2021 at 15:13:01 +0100, Julien Cristau wrote: > since upgrading from bullseye to bookworm, opening a pdf from mutt > doesn't work. The /etc/mailcap entry says: > > > application/pdf; evince --new-window %s; test=test -n "$DISPLAY" > > and indeed "evince --new-window foo.pdf" doesn't actually open foo.pdf. > > Maybe this is intended though, and the problem is how update-mime parses > evince's desktop file? Looks like it's using the Exec line from > [Desktop Action new-window] (which didn't exist in bullseye) instead of > from the main [Desktop Entry] section.
Yes, update-mime should only be parsing the fields from the [Desktop Entry] group, something like this (untested): my $in_desktop_group = 0; while (<FILE>) { chomp; next if m/^\s*$|^\s*\#/); if (m/^\[Desktop Entry\]$/) { $in_desktop_group = 1; next; } if (m/^\[.*\]$/) { $in_desktop_group = 0; next; } next unless $in_desktop_group; if (m/^Terminal=(\w+)/i) { ... the rest of the current implementation ... } The [Desktop Action x] groups are not relevant when using an application as a handler for opening files listed in MimeType. See the specification[1] for full syntax. smcv [1] https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html