mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
Mark needs_keepalive more often for WSL
Have WSL use a keepalive whenever the first process is external. This works around the fact that WSL prohibits setting an exited process as the group leader.
This commit is contained in:
parent
cef39cdcc0
commit
1b1fd5ab9b
1 changed files with 6 additions and 0 deletions
|
@ -576,6 +576,12 @@ void exec_job(parser_t &parser, job_t *j) {
|
|||
}
|
||||
}
|
||||
|
||||
// When running under WSL, create a keepalive process unconditionally if our first process is external.
|
||||
// This is because WSL does not permit joining the pgrp of an exited process.
|
||||
// (see https://github.com/Microsoft/WSL/issues/2786), also fish PR #4676
|
||||
if (j->processes.front()->type == EXTERNAL && is_windows_subsystem_for_linux())
|
||||
needs_keepalive = true;
|
||||
|
||||
if (needs_keepalive) {
|
||||
// Call fork. No need to wait for threads since our use is confined and simple.
|
||||
keepalive.pid = execute_fork(false);
|
||||
|
|
Loading…
Reference in a new issue