Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Remove process-exit event (function --on-process) #4700
As we've seen in #4582, there's a few issues with the process-exit event.
function on_exit --on-process $PID # do stuff end
But more importantly: It is fundamentally broken. It requires either getting the PID from fish - in which case one could just use the job-id instead - or guessing the PID (which does not work). It can also only ever work for fish's children.
It seems like this is only ever used to do stuff when fish exits (
So here's what I'm planning to do:
This seems to not actually be true. proc.cpp:
I can't actually get the latter to trigger (when I define an exit handler, I always get "PROCESS_EXIT", not "JOB_EXIT" in $argv). Which is annoying, since that's the one causing all those issues with WSL.
Basically, yes. Process notifications provide nothing of value over job notifications.
Both are a bit awkward to use (because you need to add this when defining the function, so you need to define a function for every time you want to use this, and after you have started the job), actually, but process notifications are even weirder.
The theoretical advantage of process notification (that I can react to one particular process in a job completing, and potentially earlier) is outweighed by it looking like it can do stuff it can't (I can't react to my firefox closing because that's not a child of fish) and by being even awkwarder to use if I actually want to do something to one particular process (since I'd have to use