mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-31 12:21:19 -03:00
Separate on-job-exit and and on-process-exit events
It is possible to run a function when a process exits via `function --on-process-exit`, or when a job exits via `function --on-job-exits`. Internally these were distinguished by the pid in the event: if it was positive, then it was a process exit. If negative, it represents a pgid and is a job exit. If zero, it fires for both jobs and processes, which is pretty weird. Switch to tracking these explicitly. Separate out the --on-process-exit and --on-job-exit event types into separate types. Stop negating pgids as well.
This commit is contained in:
@@ -28,6 +28,11 @@ function anychild --on-process-exit 0
|
||||
echo $argv[1] $argv[3]
|
||||
end
|
||||
|
||||
function anyjob --on-job-exit 0
|
||||
# Type and exit status
|
||||
echo $argv[1] $argv[3]
|
||||
end
|
||||
|
||||
echo "command false:"
|
||||
command false
|
||||
# CHECK: command false:
|
||||
|
||||
Reference in New Issue
Block a user