How do I troubleshoot Mutt html preview choking?
I had some trouble with that too. The mailcap entry for text/html is the point to look at. With chromium it was indeed the needsterminal
flag. For firefox the copiousoutput
flag did the trick.
#text/html; chromium %s; needsterminal
text/html; firefox %s;copiousoutput
If you don't already have a custom mailcap, you can create a file at ~/.mailcap
for example and add the firefox line to it. Don't forget to specify the path in your .muttrc
set mailcap_path = ~/.mailcap
Maybe it is a race condition between Firefox command line returning to mutt, and mutt deleting the temporary file before the Firefox process actually reads the file.
Try, in your mailcap entry, adding the needsterminal
flag.
Or even better, instead of calling Firefox directly, call a simple shell script of yours that copies the html file with another name and then calls Firefox on that new file, before returning command to mutt (which will delete the original file).
Some people add a sleep
command after calling firefox. See here or here for example (search for sleep
).