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

Re: process watching?



Zoltan T. Hidvegi wrote:
>Why?  What's wrong with the user code implementation?  kill -0 pid can be
>used to test for the presence of the process.  It can be put either to
>precmd or to periodic (periodic is the function name which is executed in
>every $PERIOD seconds, just before a prompt).

There's nothing inherently wrong with doing it that way.  It will work,
and be tolerably efficient.  It's fine for a one-off.  However, there is
the problem that there can only be one periodic function, so if the user
wants to do two periodic things, they must both have the same period
and both be invoked in the periodic function.  For something that is
to be used regularly, it would be nice to extend sched to do periodic
execution of this nature, or otherwise allow multiple independent
periodic functions.

-zefram



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