I imagine this is a case of fish relying on some posix behavior that isn't enforced under WSL, but the following results in backgrounded "unreachable" processes under fish/WSL:
Which is not the case under other platforms (just tested under macOS). Under WSL, the processes are dissociated from fish, as if disown or nohup were used.
As I develop fish primarily under WSL, in 1b1bc28 I added an explicit kill_background_jobs() function to emulate fish's behavior on exit for exec; I imagine this should simply be called on exit under WSL?
Unless the right thing here is for fish not get involved and let the OS do its thing? Then again, job control is purely in the domain of the shell, so inconsistent behavior across platforms in that department is fish's job, right?
(So WSL used to terminate all background processes, disowned or not, when the last WSL terminal window closed. They made an architectural decision to spawn a new init per terminal window (crazy, I know) which remains alive to support nohupd jobs or services, but in the process init doesn't kill backgrounded jobs whose session has ended, leading to this PR.)
I imagine this is a case of fish relying on some posix behavior that isn't enforced under WSL, but the following results in backgrounded "unreachable" processes under fish/WSL:
Which is not the case under other platforms (just tested under macOS). Under WSL, the processes are dissociated from fish, as if
disownornohupwere used.As I develop fish primarily under WSL, in 1b1bc28 I added an explicit
kill_background_jobs()function to emulate fish's behavior onexitforexec; I imagine this should simply be called onexitunder WSL?Unless the right thing here is for fish not get involved and let the OS do its thing? Then again, job control is purely in the domain of the shell, so inconsistent behavior across platforms in that department is fish's job, right?
(So WSL used to terminate all background processes, disowned or not, when the last WSL terminal window closed. They made an architectural decision to spawn a new
initper terminal window (crazy, I know) which remains alive to supportnohupd jobs or services, but in the processinitdoesn't kill backgrounded jobs whose session has ended, leading to this PR.)