Image preview in mutt

2025 - Aug 31

Even today, after many years of use, I am still impressed how well threads in particular can be displayed with mutt. Other, much more modern email programs and those that would like to be (yes, I'm talking about you, Outlook) make it difficult to follow email threads or hide emails that you know for sure are there.

Being a commandline email-program has pros and cons. E.g. you may not be disturbed by unnecessary formatings but on the other had graphics and graphical things may not be displayed. Over the years E-Mails changed from Text-Only messages to HTML-Formatted documents. To view HTML-Mails there are several approaches using one of the common cli-browsers e.g. w3m

For me one big issue has always been to receive images. Using a graphical image viewer or even one of those that are able to view images inside terminals such as w3m-img are useable as standalone solution but not inside the mail.

These solutions either did not show up inside of the mail-viewer or the image is not scrolling with the text.

inline Images using chafa

Chafa supports both voxel representation in terminals as well as asciiart representation.

The following entries enables mutt to view asciiart that flows with the e-mail directly in the mail viewer. Viewing images seperately with the attatchment-viewer utilizes the second line and shows a pixel image. (Using kitty as terminal)

image/*; chafa --symbols all -c 2 --fill all --polite on -s 80x80 --margin-right 40 -f symbols --color-space rgb %s ; copiousoutput; needsterminal 
image/*; chafa %s && read -rn1; needsterminal