From 7faee04d556c2b76ad2939da6af1a174b4c490a2 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Mon, 19 Oct 2015 19:17:51 +0200 Subject: [PATCH] Mutt: Fix encoding when viewing HTML in browser --- .mutt/muttrc | 2 +- .mutt/view-html.sh | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100755 .mutt/view-html.sh diff --git a/.mutt/muttrc b/.mutt/muttrc index 6fb1c9b9..7007d834 100644 --- a/.mutt/muttrc +++ b/.mutt/muttrc @@ -145,7 +145,7 @@ bind editor complete-query bind generic,alias,attach,browser,editor,index,compose,pager,pgp,postpone ':' noop ## HTML mail view with graphical Internet browser. -macro attach 'V' "cat >~/.cache/mutt/mutt-attach.mail && $BROWSER ~/.cache/mutt/mutt-attach.mail && rm ~/.cache/mutt/mutt-attach.mail" +macro attach 'V' "~/.mutt/view-html.sh" ## Remap bounce-message function to "B" bind index B bounce-message diff --git a/.mutt/view-html.sh b/.mutt/view-html.sh new file mode 100755 index 00000000..726e1db6 --- /dev/null +++ b/.mutt/view-html.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +file="${0%/*}/mail.html" +## Assume utf-8, otherwise most browsers will display ascii. +echo '' > "$file" +cat >> "$file" +$BROWSER "$file" +rm "$file"