--- bash-2.05/jobs.c Mon Mar 26 10:08:24 2001 +++ bash/jobs.c Sat Apr 28 23:51:33 2001 @@ -1202,17 +1202,6 @@ #if defined (PGRP_PIPE) if (pipeline_pgrp == mypid) { -#endif - /* By convention (and assumption above), if - pipeline_pgrp == shell_pgrp, we are making a child for - command substitution. - In this case, we don't want to give the terminal to the - shell's process group (we could be in the middle of a - pipeline, for example). */ - if (async_p == 0 && pipeline_pgrp != shell_pgrp) - give_terminal_to (pipeline_pgrp, 0); - -#if defined (PGRP_PIPE) pipe_read (pgrp_pipe); } #endif @@ -1251,9 +1240,14 @@ if (pipeline_pgrp == 0) { pipeline_pgrp = pid; - /* Don't twiddle terminal pgrps in the parent! This is the bug, - not the good thing of twiddling them in the child! */ - /* give_terminal_to (pipeline_pgrp, 0); */ + /* By convention (and assumption above), if + pipeline_pgrp == shell_pgrp, we are making a child for + command substitution. + In this case, we don't want to give the terminal to the + shell's process group (we could be in the middle of a + pipeline, for example). */ + if (async_p == 0 && pipeline_pgrp != shell_pgrp) + give_terminal_to (pipeline_pgrp, 0); } /* This is done on the recommendation of the Rationale section of the POSIX 1003.1 standard, where it discusses job control and