From b8d28158a681773247ac9dd505db6e5a53059f5c Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Wed, 24 Feb 2021 20:25:58 +0100 Subject: [PATCH] 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. --- CHANGELOG.rst | 3 ++- share/functions/__fish_config_interactive.fish | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index c87d11533..50c9f48e5 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -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`). diff --git a/share/functions/__fish_config_interactive.fish b/share/functions/__fish_config_interactive.fish index 773e992b2..17c86dab4 100644 --- a/share/functions/__fish_config_interactive.fish +++ b/share/functions/__fish_config_interactive.fish @@ -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