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

Re: Again: Background mail composition



On Tue, Oct 21, 2003 at 07:57:37PM +0100, Andrew Sayers wrote:

> Try this new version of compose.sh - it works for me with both xterm
> and screen.  There should be some way of making it spawn a background
> instance of mutt for use on the console, but I just can't get that to
> work.

Yeah, starting another Mutt in the background with the same tty will
result in a SIGSTOP being sent to the new Mutt almost immediately by
the Linux kernel as the new Mutt attempts to use the tty.  There is
no simple way of running two apps on the same tty at the same time.
(Try editing your /etc/inittab to start multiple gettys on one of your
ttys, and you'll see what I'm talking about - you'll get very odd behavior
as soon as you killall -HUP init.)

If you need to run a background process and you really don't want to
use screen or X, you can do something like this:

newtty=`cat ~/.newtty`
mutt <$newtty >$newtty 2>$newtty &

where ~/.newtty contains:
/dev/some/tty/that/you/own/and/aren't/running/anything/in/not/even/bash

Note that you'll probably want to bind some key in Mutt to a small
program for selecting the tty to use (so you can compose more than one
message in the background at a time, for instance).

macro s '<shell-escape>cat ~/.newtty ; read\n'
macro S '<shell-escape>echo Type the TTY pathname: ; read blah ; echo $blah > 
~/.newtty\n'

 - Dave

-- 
Uncle Cosmo, why do they call this a word processor?
It's simple, Skyler.  You've seen what food processors do to food, right?

Please visit this link:
http://rotter.net/israel

Attachment: pgpdzkN1Lo5rM.pgp
Description: PGP signature