Thank you for a quick fix. Bash 5.2.21 with the patch applied no longer exhibits the problem in my tests. -Mark
On Thursday, June 27, 2024 at 06:05:28 AM PDT, Chet Ramey <chet.ra...@case.edu> wrote: On 6/18/24 4:55 PM, Mark March wrote: > I am working with a large Bash code base where most scripts disable job > control and the DEBUG trap is used extensively. I noticed that if I tried to > run my scripts in the background, the interactive shell that started them > would immediately exit on any keyboard input. A simple repro is to run > > bash +m -c "/bin/echo ; trap 'trap DEBUG' DEBUG ; sleep 10" & > in an interactive shell with job control enabled. Hit Enter a few times. The > shell that launched this background process exits. The background process > itself appears to be killed by a signal. Thanks for the report. The attached patch should fix your issue, though there might be some corner cases. Let me know. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/