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

Re: Anyone familiar with auto-fu.zsh project?



Do you know if there is any way to get the PID of the process spawned for
process substitution? It looks like `$!` doesn't hold it as it does in bash.

Ideally I could kill these child processes when they're no longer needed so
that long-running ones don't tie up resources unnecessarily.

Eric Freese
303 875 2359

On Mon, Jun 11, 2018 at 3:46 AM, Sebastian Gniazdowski <
sgniazdowski@xxxxxxxxx> wrote:

> On 11 June 2018 at 10:25, Eric Freese <ericdfreese@xxxxxxxxx> wrote:
> > Wow this is much nicer. I've implemented on `develop` branch of
> > zsh-autosuggestions.
>
> Decided to do the testing, it's just checkout of develop branch and
> then normal everyday use. First impression was that suggestions appear
> very quickly, faster than with zpty.
>
> > Thank you!
>
> n/p, I use this in unpublished logger. Background process is started
> on demand with <( ), which happens when someone logs something with
> zflai-log. It stores to SQLite, MySQL, ElasticSearch, plain file. All
> works without any problems, and logging into <( ) spawned process has
> negligible duration, that's the point – someone wants MySQL logs but
> do not want slowdown.
>
> > Eric Freese
> > 303 875 2359
> >
> > On Sun, Jun 10, 2018 at 11:24 PM, Sebastian Gniazdowski
> > <sgniazdowski@xxxxxxxxx> wrote:
> >>
> >> Hello,
> >> I've just implemented async feature without using zpty. From what I
> >> saw zsh-autosuggestions uses zpty to look-up the suggestion. Maybe it
> >> has some drawbacks and you would be interested in using <( ) instead
> >> of zpty (it's probably still required to capture completions, though)?
> >> It's similar to using zpty:
> >>
> >> exec {PCFD}< <(-fast-highlight-check-path)
> >> zle -F -w "$PCFD" fast-highlight-check-path-handler
> >>
> >> -fast-highlight-check-path-handler() {
> >>     if read -r -u "$PCFD" line; then
> >>     ...
> >>     fi
> >>     zle -F ${PCFD}
> >>     exec {PCFD}<&-
> >> }
> >>
> >> <( ) process is automatically disowned, I've used it in 2 projects and
> >> it works without problems, very robust. The effect:
> >>
> >> https://asciinema.org/a/V18uHIn2BR0OVfRsmxyqkVi7K
> >>
> >> --
> >> Best regards,
> >> Sebastian Gniazdowski
> >
> >
>


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