bug-bash
[Top][All Lists]
Advanced

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

Re: unfinished command executed when TTY is closed


From: Chet Ramey
Subject: Re: unfinished command executed when TTY is closed
Date: Sun, 21 Dec 2014 22:21:22 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.2.0

On 12/18/14 12:14 PM, Jiri Kukacka wrote:

>> OK, this is the problem part.  This looks like a bug in Solaris. 
>> There's
>> no indication that the kernel sent SIGHUP before changing the behavior
>> of
>> read and write upon disconnect.
>>
>> Can you see whether or not the first bash in the chain gets a SIGHUP
>> here?
>> (Though I can't see why or how sending a SIGHUP to any process other
>> than
>> the tty's current foreground process group is useful.)
> 
> Well, I can see that SIGHUP got to first bash just a few lines later (and 
> that varies with every test, first this, then the other), and then it was 
> passed through the chain to current foreground process.
> I can have a look at tty in Solaris, but since other shells don't have this 
> problem, I think that it would be great to have bash aware of such things as 
> well.

Here's a patch that inhibits bash from returning partial lines when read(2)
returns EOF.  It works whether READLINE_CALLBACKS is defined or not (since
there are different code paths based on whether or not it is).

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

Attachment: readline-read-eof.patch
Description: Text Data


reply via email to

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