How to disable wrapping completely in mutt

mutt

I'm currently working with mutt to get it to display HTML mail properly. I've set up auto_view and a w3m invocation in the mailcap, and this works fine.

However, the URLs for links in received mail are often longer than the width of my terminal window. This makes clicking them inconvenient, because they become split across multiple lines, and I have to manually reconstruct the original URL before I can copy it to the browser.

I've set $markers to off, which successfully removes the plus sign marking a wrapped line. However, mutt is still wrapping the lines on its own (presumably just by echoing \n, since that's what I get on a copy), so it's still inconvenient to get the link.

Is there a way to tell mutt to disable wrapping completely, and just let the terminal emulator handle it? This would allow the links to be copied in one operation. There doesn't seem to be such an option for the $wrap variable; I've tried setting $wrap to far wider than the terminal width, but this doesn't work.

Best Answer

This is more related to w3m instead of mutt, to be short, you should set:

text/html; w3m -I %{charset} -T text/html -dump -cols 1000; copiousoutput

since the default vaule of cols with dump option on is around 80, which cuts off long urls.

However to see more information about url, I suggest preview as markdown format:

text/html; iconv -t 'UTF-8' -f %{charset} | pandoc -f html -t gfm-raw_html --wrap=none; copiousoutput
Related Question