On Tue, Jun 21, 2022 at 01:06:56PM +0200, Andy Spiegl wrote:
Kevin J. McCarthy wrote:Try setting TERM=xterm-256color, or add "xterm.termName: xterm-256color" to your .Xresources file
Wow, you're great! That helped although I do not understand why. Running viu (or any other image to ansi converter) in the same xterm works nicely. But for running it from within mutt the TERM variable has to be set to "xterm-256color" to make it work. Any idea why mutt behaves differently here?
viu is outputting the ansi sequences without checking if the terminal can support them. Mutt is translating the ansi into ncurses function calls, which check what terminfo says the terminal can support.
Followup question: can I make mutt run a different mailcap command when replying (and quoting the mail)? Because the editor (emacs, vim) doesn't understand the ANSI characters and then shows a long unreadable section. :-)
Note that Mutt already tries to strip ansi escape sequences from auto_view content when replying or forwarding messages. It won't strip out the graphic characters printed by the program though.
For that you'd have to jury-rig something yourself, possibly by modifying $mailcap_path, or using the 'test=' flag in mailcap, or altering auto_view settings.
-- Kevin J. McCarthy GPG Fingerprint: 8975 A9B3 3AA3 7910 385C 5308 ADEF 7684 8031 6BDA
signature.asc
Description: PGP signature