mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-29 06:13:20 +00:00
Only warn on exec for background jobs
If it's a foreground job, it is related to the currently running exec. This fixes exec in functions, i.e. function reload exec fish end would previously always ask about the "function reload" job. Fixes #5449. Fixes oh-my-fish/oh-my-fish#664.
This commit is contained in:
parent
938ce48d25
commit
60ced5dbc7
1 changed files with 4 additions and 1 deletions
|
@ -773,7 +773,10 @@ parse_execution_result_t parse_execution_context_t::populate_plain_process(
|
|||
bool have_bg = false;
|
||||
const job_t *bg = nullptr;
|
||||
while ((bg = jobs.next())) {
|
||||
if (!bg->is_completed()) {
|
||||
// The assumption here is that if it is a foreground job,
|
||||
// it's related to us.
|
||||
// This stops us from asking if we're doing `exec` inside a function.
|
||||
if (!bg->is_completed() && !bg->is_foreground()) {
|
||||
have_bg = true;
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue