On 22Jun2016 02:08, Xu Wang <xuwang...@gmail.com> wrote:
I would like to be able to do
'v' and then 'm' to open an HTML email in my browser. I can succeed in
this regard by having the following entry in ~/.mailcap:
text/html; chromium-browser %s; description=HTML Text;
However, mutt will be unresponsive until I exit the browser. This is
not my work style. So I added & to detach. This is good in the sense
that mutt now does not wait for the browser. However, by the time my
browser opens, mutt has already deleted the .html temporary file
because after adding & the command returned immediately?
Has any one come across this situation and has a similar desire?
Is there a setting I can choose to ask mutt to not delete the
temporary files? They are stored in /tmp and space is cheap so I would
like to ask mutt to not worry about them.
This is something of a standard problem with popping up HTML in an external
browser, for exactly the reasons you outline. Try something like this
(untested):
text/html; cp %s /tmp/$$.html && chromium-browser /tmp/$$.html &;
description=HTML Text;
That is still one line in case it gets folded in email. Note the html on the
temp file name, can help the browser decide how to treat it.
If you want something more elaborate (clean up the temp file after a delay) you
would use withstdin:
https://bitbucket.org/cameron_simpson/css/src/tip/bin/withstdin
Disclaimer: mine, all mine.
And try this:
text/html; withstdin --ext=.html --keepfor=10 chromium-browser <%s &;
description=HTML Text;
Cheers,
Cameron Simpson <c...@zip.com.au>