Re: Re: mailcap on Windows WSL

Jan Eden via Mutt-users <[email protected]>
Newsgroups gmane.mail.mutt.user
Message-ID <[email protected]>
On 2024-10-08 08:26, Michael Kjörling wrote:

> On 8 Oct 2024 08:55 +0200, from [email protected] (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
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----

iHUEABYKAB0WIQQg9//YDsLBcpRDSgIg03s851X+OgUCZwUzIAAKCRAg03s851X+
OmsTAQCf4Gfo61AecQtMyliQgGsaPjgWNWzt4tgwQkL3b2lQIgEAlAW/E+leOD1x
RuHpewRzof2CED57twZPOIbmdoJb4wE=
=RXgn
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.