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

Re: [PATCH] Add customizable `vcs` prompt theme (was Re: [RFC][PATCH] `newuser` prompt theme)



On Wed, Jun 23, 2021 at 8:26 PM Roman Perepelitsa
<roman.perepelitsa@xxxxxxxxx> wrote:
>
> > > I see that the code is sending SIGKILL now and not waiting for the
> > > process to terminate. Both of these make me nervous. The code also
> > > *looks like* it would work without monitor but it wouldn't (it would
> > > result in unbounded background processes and zombies). What do you
> > > think about not killing anything and ensuring that at most one
> > > background process runs at once? This is what I do in my zsh theme and
> > > it works well.
> >
> > That sounds great, but I have no idea how to do that. :) Can you give
> > me some pointers?
>
> Start a new process in precmd if none are running. If one is already
> running, don't start a new process but remember that its results are
> "dirty". When a background process completes, display its results if
> they aren't marked dirty. If they are marked dirty, don't display the
> results but start a new process instead.

Using this approach, how would you deal with processes that (for all
practical purposes) might potentially never finish? In that case, your
callback function will never get called and you'll never start a new
process again.




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