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)
- X-seq: zsh-workers 50447
- From: Marlon Richert <marlon.richert@xxxxxxxxx>
- To: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: [PATCH] Add customizable `vcs` prompt theme (was Re: [RFC][PATCH] `newuser` prompt theme)
- Date: Mon, 8 Aug 2022 13:12:41 +0300
- Archived-at: <https://zsh.org/workers/50447>
- In-reply-to: <CAN=4vMqOpx=8fg2rOPxDwn_Qh34H8-224zXz+L325H5Mzj5dmw@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <7E71FA83-356E-448B-9726-02DF3FF5BD14@gmail.com> <CAH+w=7ZBsfiJwC-PYBvOVgrgGmC4RTYt9rRroGiqo_rzVSBJHQ@mail.gmail.com> <873D08A9-F321-474A-8440-CCE7DCCBA529@gmail.com> <20210414120551.GA3882@tarpaulin.shahaf.local2> <6CEA4F3E-9A64-44E1-9121-FA9D5E053AB5@gmail.com> <20210414140909.GG3882@tarpaulin.shahaf.local2> <CAHYJk3SQjaTdiLMQcQFhrkp3rMcX+8gCgJpfT1f=-fPSN2-A9Q@mail.gmail.com> <29E16F69-B09E-44BF-9009-1CF53053D4FC@gmail.com> <20210416171321.GC4535@tarpaulin.shahaf.local2> <93FFDA3D-3C4A-414E-9220-1032ECE5B04C@gmail.com> <20210416193037.GD15670@tarpaulin.shahaf.local2> <E68B37FB-ADEC-44DF-9E0F-E550180DFC41@gmail.com> <9dc589f1-65b6-48b7-a7cb-81f9e2e16795@www.fastmail.com> <CAH+w=7ZP5gToWM2VZhLtQJeM+GEqRaTLdCxe64SJuKH0X37b9g@mail.gmail.com> <48174137-a8a7-4171-bcda-0899ebc19433@www.fastmail.com> <CAHLkEDvoPHcanaFDnrE0H0PSOB72B3S8g1r7LK2295A6h-mL3A@mail.gmail.com> <8082812e-b595-403b-9c8c-8956b6af08cd@www.fastmail.com> <be8bac59-10f7-4a82-81d7-3d327ef057ec@www.fastmail.com> <CAHLkEDsBJEmMmrr84ZwmjQa+Na3K6paJKbom7syDJqov8iemFg@mail.gmail.com> <CAN=4vMqwAXM3AO1s91GEgDEWdOUS7mXA0SBceCZeCP_4dCoNfw@mail.gmail.com> <CAHLkEDuX-pSfSHXb6yE7HnrCfgZD9HB0U=hwi8huRxN0QeKbuA@mail.gmail.com> <CAN=4vMo9_FHO+Th_NYmXhQwFxAD=sU1AqLTs7AGb9db1W-CDkA@mail.gmail.com> <CAHLkEDupdk6Y95_Ju68GG-t0mtjd7yXgrwE+BAZwCNtUiok=mA@mail.gmail.com> <CAN=4vMqqG1FvpraLMePSbXRWa-sUsBH=_WNu1Ox6qMO6QJgd+g@mail.gmail.com> <CAHLkEDvgYL7ZfAOyqM37Ui2T8Lqee63aZKwQHjYigPJ5d2LLdA@mail.gmail.com> <CAN=4vMqOpx=8fg2rOPxDwn_Qh34H8-224zXz+L325H5Mzj5dmw@mail.gmail.com>
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