<<< Date Index >>>     <<< Thread Index >>>

Re: From Jiang: question about dialog and mutt



On 2007-09-21, Jiang Qian <jqian@xxxxxxxxxxxxxxxxxxx> wrote:
> Hi all:
>       I'm trying to implement this script for checking whether I 
> forget to put on attachment. I try to follow this procedure:
>       http://wiki.mutt.org/?ConfigTricks/CheckAttach
>       The only difference is that I want to use a text based dialog 
> instead of zenity. The reason is that I'm accessing my mailbox on a 
> remote computer through ssh. I can forward Xdialog or zenith dialog box 
> via x11 over ssh, but that slows down the whole thing considerably, and 
> defeat the purpose of having a text based client. I'm a text console 
> purist:)
>       Now I wanted to to implement it in the following manner. In 
> place of zenity, I used
> dialog --title "mutt" --clear \
>       --yesno "Have you added your attachment?" 10 30
>       The problem is that when I do this, the mutt simply hang on the 
> sending mail screen. My understanding is that zenity want to draw a 
> dialog box like this:
>       http://physics.harvard.edu/~jqian/dialog.png
>       But mutt does not surrender the text terminal display. I tried 
> various ways to suspend mutt but cannot get it to work. Is it a 
> fundamental limitation of mutt in text console, and I have to give up 
> and use graphic things like Xdialog or zenity instead? Or is there a way 
> to let mutt give up the screen for a sec and display my choice dialog?

Mutt doesn't lock the display when it calls sendmail--it has no 
means to do so--so this isn't a matter of mutt not surrendering the 
display.  This appears to be a problem with your script.  Not being 
able to see or try your script, it's hard to tell.

This is just a hunch, but since the script's stdin is connected to a 
pipe from which it receives the message text, you may have to tell 
dialog to use /dev/tty as its stdin and/or stdout, something like 
this:

   dialog --yesno "Can you see me now?" 20 20 < /dev/tty > /dev/tty

HTH,
Gary