Do disown the completion updating without $last_pid

In this context, as it stands, $last_pid will give fish's pid (because
of pgroup shenanigans).

Since that doesn't really work, just `disown` without and let fish
figure out what the last process was.

Theoretically this has an issue if someone started a background
process *before* the python script *and* that exits before we run
disown.

That's a vanishingly small window and this is only run on first start,
so it seems acceptable.

Fixes #7739.
This commit is contained in:
Fabian Homborg 2021-02-24 20:25:58 +01:00
parent b154ad6a5c
commit b8d28158a6
2 changed files with 3 additions and 2 deletions

View file

@ -766,7 +766,8 @@ Interactive improvements
- History newly imported from bash includes command lines using ``&&``
or ``||``.
- The automatic generation of completions from manual pages is better
described in job and process listings (:issue:`6269`).
described in job and process listings, and no longer produces a
warning when exiting fish (:issue:`6269`).
- In private mode, setting ``$fish_greeting`` to an empty string before
starting the private session will prevent the warning about history
not being saved from being printed (:issue:`6299`).

View file

@ -94,7 +94,7 @@ function __fish_config_interactive -d "Initializations that should be performed
# Run python directly in the background and swallow all output
$python $update_args >/dev/null 2>&1 &
# Then disown the job so that it continues to run in case of an early exit (#6269)
disown $last_pid >/dev/null 2>&1
disown >/dev/null 2>&1
end
end
end