Re: Using "viu" to display attached images

2022-07-06 Thread Andy Spiegl
Hi Kevin, > There isn't a clean built-in way to do what you want, so you'll have to get > creative. Very clever. I like it! When I read "creative" I remembered mutt's hooks and started playing around with them. My first idea was: # Turn off autoview before a reply: reply-hook ~A 'unset

Re: Using "viu" to display attached images

2022-07-04 Thread Kevin J. McCarthy
On Tue, Jun 28, 2022 at 12:01:34PM +0200, Andy Spiegl wrote: I think the problem why it doesn't work here is that "reply" is interactive. Whatever follows in the macro is appended to the "To: " prompt. Is there a way to "wait" until the operation is done? There isn't a clean built-in way to

Re: Using "viu" to display attached images

2022-06-28 Thread Andy Spiegl
Cameron wrote: thanks for the detailled explanation. Nice use of cmd variables! > >I tried unsuccessfully: > > macro index r "\ > > unset implicit_autoview\ > > \ > > set implicit_autoview" > > Does that not work? I would expect it to. I think the problem why it doesn't work here is that

Re: Using "viu" to display attached images (SOLVED)

2022-06-27 Thread Cameron Simpson
On 22Jun2022 01:02, Andy Spiegl wrote: >Cool ideas. I started with defining a macro like that: > > macro index r "\ > unset implicit_autoview\ > " > >Works! But I don't know how to set it back afterwards, uhm. >I tried unsuccessfully: > macro index r "\ > unset implicit_autoview\ > \ > set

Re: Using "viu" to display attached images (SOLVED)

2022-06-27 Thread Andy Spiegl
Hi, I'd really appreciate help with this: > > Cool ideas. I started with defining a macro like that: > > macro index r "\ > unset implicit_autoview\ > " > > Works! But I don't know how to set it back afterwards, uhm. > I tried unsuccessfully: > macro index r "\ > unset

Re: Using "viu" to display attached images (SOLVED)

2022-06-21 Thread Andy Spiegl
Kevin J. McCarthy wrote: > 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. Cool ideas. I started with defining a macro like that: macro index r "\ unset implicit_autoview\ "

Re: Using "viu" to display attached images (SOLVED)

2022-06-21 Thread Kevin J. McCarthy
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

Re: Using "viu" to display attached images (SOLVED)

2022-06-21 Thread Andy Spiegl
Kevin J. McCarthy wrote: > With $allow_ansi, Mutt will interpret ansi sequences _it understands_ and > convert them to curses calls. Interesting! This explains some of my observations. > Try setting TERM=xterm-256color, or add "xterm.termName: xterm-256color" to > your .Xresources file Wow,

Re: Using "viu" to display attached images

2022-06-20 Thread Kevin J. McCarthy
On Tue, Jun 21, 2022 at 08:47:31AM +1000, Cameron Simpson wrote: On 20Jun2022 11:15, Kevin J. McCarthy wrote: With $allow_ansi, Mutt will interpret ansi sequences _it understands_ and convert them to curses calls. I don't currently have viu available to play with, but perhaps it's emitting

Re: Using "viu" to display attached images

2022-06-20 Thread Cameron Simpson
On 20Jun2022 11:15, Kevin J. McCarthy wrote: >With $allow_ansi, Mutt will interpret ansi sequences _it understands_ >and convert them to curses calls. I don't currently have viu available >to play with, but perhaps it's emitting sequences Mutt doesn't >understand. How hard is it to extend

Re: Using "viu" to display attached images

2022-06-20 Thread Kevin J. McCarthy
On Mon, Jun 20, 2022 at 01:20:16PM -0400, Rob Pyott wrote: Hi, is there a way to get viu running without a .mailcap file? (I have a basic rc file.). Thanks! Rob No, mailcap (and mime.types) is the way to configure attachment handling in Mutt. There's a whole chapter in the manual about this,

Re: Using "viu" to display attached images

2022-06-20 Thread Kevin J. McCarthy
On Mon, Jun 20, 2022 at 11:15:50AM -0700, Kevin J. McCarthy wrote: However, if this also happens with a regular mailcap invocation (using and an entry without the copiousflag setting), then something else may be going on. Re-reading the thread, I just noticed you have TERM set to xterm. Try

Re: Using "viu" to display attached images

2022-06-20 Thread Kevin J. McCarthy
On Mon, Jun 20, 2022 at 07:40:17PM +0200, Andy Spiegl wrote: The copiousoutput flag could be making a difference here. That will cause Mutt to render the output of the command internally, which by default will strip all ansi output. Even if I set "allow_ansi"? With $allow_ansi, Mutt will

Re: Using "viu" to display attached images

2022-06-20 Thread Andy Spiegl
Kevin, > The copiousoutput flag could be making a difference here. That will cause > Mutt to render the output of the command internally, which by default will > strip all ansi output. Even if I set "allow_ansi"? > If you really want to view it inside Mutt's pager, you could set > $allow_ansi.

Re: Using "viu" to display attached images

2022-06-20 Thread Rob Pyott
Hi, is there a way to get viu running without a .mailcap file? (I have a basic rc file.). Thanks! Rob On Mon, Jun 20, 2022, 1:02 PM Kevin J. McCarthy wrote: > On Mon, Jun 20, 2022 at 12:19:13AM +0200, Andy Spiegl wrote: > >Hi, > > > >recently I discovered the command line program "viu" ( >

Re: Using "viu" to display attached images

2022-06-20 Thread Kevin J. McCarthy
On Mon, Jun 20, 2022 at 12:19:13AM +0200, Andy Spiegl wrote: Hi, recently I discovered the command line program "viu" (https://github.com/atanunq/viu) which very nicely displays images in terminal windows. I added this line to my .mailcap: image/*; viu -t -n %s ; copiousoutput The

Re: Using "viu" to display attached images

2022-06-20 Thread Andy Spiegl
Hi Oleg, thanks for your reply. > Below works for me (displays image until pressing any key): > > image/*; viu -t %s && read -n 1 Doesn't work for me. :-( Actually, it's not ALL black but mixed black and white blocks. If I maximize the size of the xterm I can vaguely recognize the image.

Re: Using "viu" to display attached images

2022-06-20 Thread Oleg A. Mamontov
Hello, On Mon, Jun 20, 2022 at 12:19:13AM +0200, Andy Spiegl wrote: Hi, recently I discovered the command line program "viu" (https://github.com/atanunq/viu) which very nicely displays images in terminal windows. I added this line to my .mailcap: image/*; viu -t -n %s ; copiousoutput