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

Re: Frozen command substitution



On Sat, Feb 11, 2023 at 09:36:01AM -0800, Bart Schaefer wrote:
> On Sat, Feb 11, 2023 at 9:03 AM Dominik Vogt <dominik.vogt@xxxxxx> wrote:
> >
> > On Sat, Feb 11, 2023 at 10:41:07AM +0100, Dominik Vogt wrote:
> > > foo freezes in a call of bar and won't wake up anymore when bar
> > > terminates:
> >
> > >               R="$(bar some arguments)"  <------- hangs in this line
> >
> > Apparingly this does not happen if the line is rewritten to
> >
> > >               bar some arguments | read R
>
> Look for a file or pipe that's been opened in foo to which the
> subshell for bar might still have a descriptor (obviously other than
> the fd to return bar's output).

Hm, either script may restart the browser if the browser hangs.
After killing it I use this to restart it:

  start-browser () {
          ( set -m; "$BROWSER" <options> <url> &! )
  }

Does this have some side effect that I'm not aware of?  The idea
was to decouple the browser from the script so that it won't be
killed when the script ends.

(This is all a bit more complicated because the browser runs
inside a sandbox (firjail) and killing the browser actually means
terminating the sandbox.  But I think that's not part of the
problem.)

Ciao

Dominik ^_^  ^_^

--

Dominik Vogt




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