From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17970 invoked by alias); 13 May 2013 16:21:30 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 31398 Received: (qmail 7540 invoked from network); 13 May 2013 16:21:23 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_PASS autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at samsung.com does not designate permitted sender hosts) X-AuditID: cbfec7f5-b7f376d000001ec6-94-519112fe64c6 Date: Mon, 13 May 2013 17:21:17 +0100 From: Peter Stephenson To: Zsh Hackers' List Subject: Re: zpty -r and pipes Message-id: <20130513172117.6c6c8ee5@pwslap01u.europe.root.pri> In-reply-to: <20130513152720.GA10320@chaz.gmail.com> References: <20130513152720.GA10320@chaz.gmail.com> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupmluLIzCtJLcpLzFFi42I5/e/4Fd1/QhMDDU5u1LE42PyQyYHRY9XB D0wBjFFcNimpOZllqUX6dglcGYcPr2UruMtW8bv1OEsD41TWLkZODgkBE4n/c39B2WISF+6t Z+ti5OIQEljKKPFz/ixGCGc5k8SMA4vAqlgEVCVuXL7PDGKzCRhKTN00G6iIg0NEQFui/aMY SFhYQE7ixZQnjCA2r4C9xI+jP9lBbE6gZbt3zGUHKRcSMJbomFEHEuYX0Je4+vcTE8QN9hIz r5yBahWU+DH5HguIzSygJbF5WxMrhC0vsXnNW+YJjAKzkJTNQlI2C0nZAkbmVYyiqaXJBcVJ 6blGesWJucWleel6yfm5mxghAfh1B+PSY1aHGAU4GJV4eF/+mBAoxJpYVlyZe4hRgoNZSYR3 P+/EQCHelMTKqtSi/Pii0pzU4kOMTBycUg2MxyfXTt/Y9zQ8TfDBhZ0O9luXl6ckWxuvk4jb +f1bzvSAExur4lplV2yIZb3TWy9/N8fj9ua6jwZeHfwxyko1jYpnrD4ViyzZdmrfWQGHHzsf BDc+M7VdlOu/nLX8Z/i1qbN8dJneb5tpnlbiKFTQ09Dxrtbpj9QBY11VMQHH/bM/vc6rLi5W YinOSDTUYi4qTgQAf9qiCh4CAAA= On Mon, 13 May 2013 16:27:20 +0100 Stephane Chazelas wrote: > $ zsh -c 'zmodload zsh/zpty; zpty E echo test; zpty -r E' > test > > But if I pipe it to anything: > > $ zsh -c 'zmodload zsh/zpty; zpty E echo test; zpty -r E | cat' > $ > > No output. > > Those are fine though: > > $ zsh -c 'zmodload zsh/zpty; zpty E echo test; echo $(zpty -r E)' > test > $ zsh -c 'zmodload zsh/zpty; zpty E echo test; {zpty -r E} | cat' > test First guess and without looking into it is it might be a job control thing. Those look just the circumstances where we wouldn't have a special job in a subshell (pipeline) or where we would (command substitution, new current-shell process before the fork). But I could just be wasting typing time. Not sure what this has got to do with file descriptors anyway. pws