From b9a95a48b45aa05da29464435a749fb5a819981c Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Thu, 28 Oct 2021 10:02:48 -0700 Subject: [PATCH] Test that --on-job-exit functions run even if the job has already exited If you define a function that you want to be called after a job has exited, it should run immediately if that job has already exited. --- tests/checks/jobs.fish | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/checks/jobs.fish b/tests/checks/jobs.fish index 766ea7e24..f8836016f 100644 --- a/tests/checks/jobs.fish +++ b/tests/checks/jobs.fish @@ -123,3 +123,10 @@ emit bar command true & set -l truepid $last_pid test $truepid != $fish_pid || echo true has same pid as fish + +# Job exit events work even after the job has exited! +sleep .5 +function thud --on-job-exit $truepid + echo "thud called" +end +# CHECK: thud called