|
|
 | | From: | Ville Herva | | Subject: | Using a signal to commit changes to mailbox and exit | | Date: | 31 Dec 2004 22:49:51 GMT |
|
|
 | I assume this has been brought up before, but I failed to find it in the archives. Every once in a while I run into a situation, where I have mutt running elsewhere holding changes to a mailbox. I would like to exit that mutt instance so that it commits the changes to be able to start a new mutt instance using the mailbox. (kill -INT exits the mutt without commiting the changes to the mailbox.) I usually run mutt only under screen (so please don't suggest that :), but sometimes (rarely) I don't (for whatever reason, forgetting to do so being most likely one) - and then these situations come up. Slightly more common case is where screen goes into a state where I can no longer attach to it. In that case, I'd obviously prefer to be able to exits the mutt's under it gracefully. It would be nice if there was a signal (perhaps kill -USR1 ?) upon which mutt would commit changes and exit. Alternative suggestions welcomed. Ones that work without patching mutt get bonus :).
-- v --
v@iki.fi
|
|
 | | From: | Sven Guckes | | Subject: | Re: Using a signal to commit changes to mailbox and exit | | Date: | 1 Jan 2005 13:06:07 GMT |
|
|
 | * Ville Herva [2004-12-31]: > Every once in a while I run into a situation, where I have > mutt running elsewhere holding changes to a mailbox. I would > like to exit that mutt instance so that it commits the changes > to be able to start a new mutt instance using the mailbox.
'q' (quit)
> (kill -INT exits the mutt without commiting the changes to the mailbox.)
duh
> I usually run mutt only under screen (so please don't suggest > that :), but sometimes (rarely) I don't (for whatever reason, > forgetting to do so being most likely one) - and then these > situations come up. Slightly more common case is where screen > goes into a state where I can no longer attach to it. > In that case, I'd obviously prefer to be able > to exits the mutt's under it gracefully.
this is not a mutt problem.
> It would be nice if there was a signal (perhaps kill -USR1 ?) > upon which mutt would commit changes and exit.
and you'd also like signals not only for "exit" and "quit", but also for all the other commands, right? think again!
> Alternative suggestions welcomed. > Ones that work without patching mutt get bonus :).
killall -9 mutt
but you'd better hide that from the RSPCA..
Sven
|
|
 | | From: | Ville Herva | | Subject: | Re: Using a signal to commit changes to mailbox and exit | | Date: | 1 Jan 2005 15:51:29 GMT |
|
|
 | In article <2005-01-01T13-02-49@guckes.net>, Sven Guckes wrote: > * Ville Herva [2004-12-31]: > > Every once in a while I run into a situation, where I have > > mutt running elsewhere holding changes to a mailbox. I would > > like to exit that mutt instance so that it commits the changes > > to be able to start a new mutt instance using the mailbox. > > 'q' (quit)
Yes, but how do I do that if my screen session is malfunctional or the mutt instance was not started under mutt in the first place? > > I usually run mutt only under screen (so please don't suggest > > that :), but sometimes (rarely) I don't (for whatever reason, > > forgetting to do so being most likely one) - and then these > > situations come up. Slightly more common case is where screen > > goes into a state where I can no longer attach to it. > > In that case, I'd obviously prefer to be able > > to exits the mutt's under it gracefully. > > this is not a mutt problem. > > > It would be nice if there was a signal (perhaps kill -USR1 ?) > > upon which mutt would commit changes and exit. > > and you'd also like signals not only for "exit" and "quit", > but also for all the other commands, right? think again!
I don't think other actions need a signal.
Thinking further, this might be sensible default action for HUP signal.
This is what pine does when it gets a HUP signal: it commits the changes so that they are not lost. In fact, my colleague (being a Pine fan) makes fun of me when I lose my changes on HUP. (Preferably this might be configurable.) > killall -9 mutt
Thank you very much for your valuable insights.
-- v --
v@iki.fi
|
|
 | | From: | Sven Guckes | | Subject: | Re: Using a signal to commit changes to mailbox and exit | | Date: | 1 Jan 2005 20:02:33 GMT |
|
|
 | * Ville Herva [2005-01-01]: > Sven Guckes wrote: >> * Ville Herva [2004-12-31]: >> > Every once in a while I run into a situation, where I have >> > mutt running elsewhere holding changes to a mailbox. I would >> > like to exit that mutt instance so that it commits the changes >> > to be able to start a new mutt instance using the mailbox. >> >> 'q' (quit) > > Yes, but how do I do that if my screen session is malfunctional
!echo $STY
but why add code for mutt that?
> or the mutt instance was not started under mutt in the first place?
huh?
>> > It would be nice if there was a signal (perhaps kill -USR1 ?) >> > upon which mutt would commit changes and exit. >> >> and you'd also like signals not only for "exit" and "quit", >> but also for all the other commands, right? think again! > > I don't think other actions need a signal.
however, once you add actions for signals, other users will add requests for more. "why doesn't it fetch my mail when i give it the 'kick' signal?" etc
> Thinking further, this might be sensible > default action for HUP signal. > (Preferably this might be configurable.)
i sense a patch coming up..
> This is what pine does when it gets a HUP signal: > it commits the changes so that they are not lost. > In fact, my colleague (being a Pine fan) > makes fun of me when I lose my changes on HUP.
well... "use pine!"
Sven
|
|
|