jobs --last --pid gives the pid of the most recently started job that is still running (or nothing if none is running), while $last_pid will give what one expects regardless.
This PR does very little difference in practice (the only thing it fixes is that, in the unlikey case one has other running jobs and the even more unlikely case the whole background fish process ends before jobs --last --pid is called, hydro may end up terminating an unrelated job), so don't think too much about it if you feel it may introduce other issues.
jobs --last --pid
gives the pid of the most recently started job that is still running (or nothing if none is running), while$last_pid
will give what one expects regardless.Try:
This PR does very little difference in practice (the only thing it fixes is that, in the unlikey case one has other running jobs and the even more unlikely case the whole background fish process ends before
jobs --last --pid
is called, hydro may end up terminating an unrelated job), so don't think too much about it if you feel it may introduce other issues.