Re: give_terminal_to after re-backgrounded async job
From:
Chet Ramey
Subject:
Re: give_terminal_to after re-backgrounded async job
Date:
Mon, 10 Jul 2023 09:54:34 -0400
User-agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.12.0
On 7/7/23 12:43 PM, Grisha Levit wrote:
The fix [1] for the issue reported in [2]:
+ give the terminal to pipeline_pgrp. We don't give the terminal
+ back to shell_pgrp if an async job exits because we never gave it
+ to that job in the first place. */
if ((flags & JWAIT_NOTERM) == 0 && running_in_background == 0 &&
+ (job == NO_JOB || IS_ASYNC (job) == 0) &&
(subshell_environment & (SUBSHELL_ASYNC|SUBSHELL_PIPE)) == 0)
give_terminal_to (shell_pgrp, 0);
makes bash not take the terminal back when an async job is brought to the
foreground with `fg' and then subsequently TSTP-ed.
Thanks for the report; easy fix.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/