Why is emacs not opening my attachments?

It so happens that I am unable to open attachments with mu4e; a terminal window (xterm?) briefly opens and then closes and nothing is shown. According to this question, it is because emacs kills the terminal (and the spawned process) too early. Notably, it seems that opening pdfs works from org.

So I investigate what is called by mu4e when opening attachments; checking with M-x view-lossage I find out that the function that is called when opening the attachment is gnus-article-press-button.

It appears that I have to modify a file called .mailcap in my home, containing the line

application/*; xdg-open %s

We then also need to call M-x mailcap-parse-mailcaps to force a re-read of the file. I got this information from the wiki