bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Script with set -m launched from interactive shell makes all ancesto


From: Chet Ramey
Subject: Re: Script with set -m launched from interactive shell makes all ancestor shells die
Date: Fri, 15 Aug 2014 09:33:45 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0

On 8/13/14, 4:40 PM, Chet Ramey wrote:

>> Make it executable, and type
>>
>> ./foo &
>>
>> at an interactive shell.  You get your shell prompt back.  You can press
>> Enter as many times as you like.  But if you press any key other than
>> Enter, the entire terminal window goes away.
> 
> I haven't looked at this yet, but here's what I bet is happening: turning
> on job control with set -m causes several things to happen: the shell
> creates a new process group and becomes the process group leader, sets the
> terminal's process group to its own process group, and creates children in
> their own process group.
> 
> Now that the terminal is no longer in the parent shell's process group,
> reads return EOF (or -1/EIO), and the parent shell exits.

It was something very similar to this.  The shell needs to note whether or
not it is running in the foreground before modifying the terminal's process
group.  I will make those changes for the next version.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]