mailcap on Windows WSL
Jan Eden
tech at eden.one
Tue Oct 8 13:26:56 UTC 2024
On 2024-10-08 08:26, Michael Kjörling wrote:
> On 8 Oct 2024 08:55 +0200, from mutt-users at mutt.org (Jan Eden via Mutt-users):
> > I need to use mutt within the WSL of MS Windows. To display HTML
> > mails via mailcap, I created a small script which reads from STDIN,
> > writes a temporary file and opens it with the Edge browser:
> >
> > # ~/.mutt/mailcap
> > text/html; ~/.mutt/htmlviewer html
> >
> > # ~/.mutt/htmlviewer
> > with open('/var/tmp/htmlfile', 'w') as tmp_file:
> > for line in sys.stdin:
> > tmp_file.write(line)
> >
> > This works for some messages, but for others, a UnicodeEncodeError is
> > returned:
>
> Try using something not quite as clever.
>
> #!/bin/sh
> cat - >/var/tmp/htmlfile
> [whatever you need to do to open it in Edge goes here]
>
> An alternative might be to offload to something like xdg-open or
> Windows' "start" from within the mailcap, if you can do that from
> within WSL; with or without "needsterminal" in the mailcap.
That looks definitely smarter than my "clever" solution (which worked
with the addition suggested by José).
Thank you,
Jan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.mutt.org/pipermail/mutt-users/attachments/20241008/d97b84d6/attachment.asc>
More information about the Mutt-users
mailing list