Skip to content

Generate job & process exit events for background jobs - #9096

Closed
Baspar wants to merge 1 commit into
fish-shell:masterfrom
Baspar:master
Closed

Generate job & process exit events for background jobs#9096
Baspar wants to merge 1 commit into
fish-shell:masterfrom
Baspar:master

Conversation

@Baspar

@Baspar Baspar commented Jul 29, 2022

Copy link
Copy Markdown
Contributor

Description

Allow for --on-process-exit and --on-job-exit to be called inside of an event handler, as long as it is from a background job

(partially) Fixes issue #8766

Reproducing the issue

function __test_background_job_exit_event --on-variable dummy_var
  sleep 1&
  function callback --on-process-exit (jobs --last --pid)
    echo -n "Callback called"
  end
end

set dummy_var ""
# after 1s, "Callback called" will be printed on the screen

@ridiculousfish

Copy link
Copy Markdown
Member

Merged as 2410e27 - thank you!

@ridiculousfish ridiculousfish added this to the fish 3.6.0 milestone Jul 30, 2022
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jul 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants