Re: Strange bash behavior

2016-12-02 Thread Chet Ramey
On 12/2/16 2:31 AM, Vladimir Marek wrote: > Still, this stops the bash: > > bash -c 'bash -i 1; read -t 2 a < /dev/tty' Yes, Clark found and fixed this problem. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet

Re: Strange bash behavior

2016-12-02 Thread Chet Ramey
On 12/2/16 1:20 AM, Clark Wang wrote: > Found the problem. The first "bash -i" changed the foreground pgrp to its > own pgrp at startup but did not restore the original foreground pgrp when > it exited. The following patch (not a real fix) works for me: > > --- a/shell.c > +++ b/shell.c > @@

Re: Strange bash behavior

2016-12-02 Thread Vladimir Marek
> > Nice analysis, does the second example look similar? > > > > bash -c 'bash -i 1; read -t 2 a < /dev/tty' > > > > I think it's the same problem. After "bash -i" exited, "bash -c" is not the > controlling process any more so it cannot read from the tty. Ah, I see. Thanks! -- Vlad

Re: Strange bash behavior

2016-12-02 Thread Clark Wang
On Fri, Dec 2, 2016 at 6:34 PM, Vladimir Marek wrote: > Nice analysis, does the second example look similar? > > bash -c 'bash -i 1; read -t 2 a < /dev/tty' > I think it's the same problem. After "bash -i" exited, "bash -c" is not the controlling process any more so

Re: Strange bash behavior

2016-12-02 Thread Vladimir Marek
Nice analysis, does the second example look similar? bash -c 'bash -i 1; read -t 2 a < /dev/tty' Thanks! -- Vlad On Fri, Dec 02, 2016 at 12:59:37PM +0800, Clark Wang wrote: > On Fri, Dec 2, 2016 at 6:28 AM, Vladimir Marek > wrote: > > > Hi, > > > > I'm not

Re: Strange bash behavior

2016-12-02 Thread Vladimir Marek
> > I'm not sure what is going on, but the bash test suite was getting > > stopped (as if SIGSTOP was received) in the middle. Trying to find > > minimal set of conditions it came to this: > > > > - my ~/.bashrc has to contain 'cd /' (any dir works) > > - the tests have to first execute

Re: Strange bash behavior

2016-12-02 Thread Clark Wang
On Fri, Dec 2, 2016 at 12:59 PM, Clark Wang wrote: > On Fri, Dec 2, 2016 at 6:28 AM, Vladimir Marek > wrote: > >> Hi, >> >> I'm not sure what is going on, but the bash test suite was getting >> stopped (as if SIGSTOP was received) in the middle.

Re: Strange bash behavior

2016-12-01 Thread Clark Wang
On Fri, Dec 2, 2016 at 6:28 AM, Vladimir Marek wrote: > Hi, > > I'm not sure what is going on, but the bash test suite was getting > stopped (as if SIGSTOP was received) in the middle. Trying to find > minimal set of conditions it came to this: > > - my ~/.bashrc has

Re: Strange bash behavior

2016-12-01 Thread Chet Ramey
On 12/1/16 2:28 PM, Vladimir Marek wrote: > Hi, > > I'm not sure what is going on, but the bash test suite was getting > stopped (as if SIGSTOP was received) in the middle. Trying to find > minimal set of conditions it came to this: > > - my ~/.bashrc has to contain 'cd /' (any dir works) > -