On 2024-10-08 08:26, Michael Kjörling wrote: > On 8 Oct 2024 08:55 +0200, from mutt-users@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
signature.asc
Description: PGP signature