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

Re: Exiting zsh with jobs in background

> st> Is there any way to turn off the "zsh: you have running jobs."
> st> message that appears when you try to exit zsh with jobs in the
> st> background?  I have the "nohup" option set so that zsh won't kill
> st> those jobs, but I'd like to be able to exit the shell without
> st> being nagged about running jobs.
> Hrv> There is no way to turn it off.  I once posted a patch that made
> Hrv> zsh behave like bash in that respect (i.e. not to warn about
> Hrv> running job when nohup is set), but it was rejected.
> On the small number of occasions I actually i) log out, and ii) have
> jobs running, and hence get the warning, I just disown them.

I don't need to disown them at this point -- since I have nohup set I just hit
Ctrl-D again and the shell exits.  The problem is that I want to avoid the
message if I can.  Having nohup set should allow me to do this...

> If I was really keen, maybe I'd have done something in .zlogout to
> disown all my running jobs.

By the time .zlogout gets sourced it is too late to disown the jobs.  You could
put a function in precmd that disowns jobs immediately, but then you lose job
control.  Clearly a "nowarn" option is needed for zsh.



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