mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-28 04:03:39 +08: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
|
@ -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 New Issue
Block a user