Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Jobs should be marked as completed when all processes are completed, not just the last one #876

@ridiculousfish

Description

@ridiculousfish

This issue tracks the following change: mark a job as completed only when all processes are finished.

An example of an affected command:

 sleep 10 | echo Hi

Today in fish, this finishes immediately, because echo does not read from its input pipe. With this change, this job will not finish for 10 seconds.

Advantages:

  1. It's arguably more intuitive
  2. It makes it possible to implement pipefail (add pipefail #763), because we will wait until we have the exit status of all commands in the pipeline
  3. It eliminates a certain class of race conditions that occur if the last process is not in the process group of the session leader (pwd | pwd crashes #848)
  4. It matches bash and zsh (though not tcsh)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions