Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: "You have running jobs" warning



> In your mail, you said:
> > >I am not sure I follow you.
> > >          MONITOR (-m)
> > >               Allow job control.  Set by default in  interactive
> > >               shells.
> > > 
> > >What does this have to do with what I have written?
> > 
> > If you disable job control, you will not get the warning when
> > terminating the shell.
> 
> Well, yes of course. If I kill -9 $$, I will also get no warning, but it is
> definitely not what I had in mind.

You can alias exit to 'unsetopt monitor ; exit' or you can write an exit
function which checks if there are suspended jobs and exits unconditionally
if no suspended jobs found and gives a warning otherwise.  This way you can
write an exit which does exactly what you want.  The main point that this
can be done uning the existing shell tools so we should not complicate the
code with this.  Also many people (including myself) perfer the present
behaviour.  I always use setopt nohup but I'd still like to get warnings.

Zoltan




Messages sorted by: Reverse Date, Date, Thread, Author