From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 623 invoked from network); 29 Jul 2009 19:19:20 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from new-brage.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.254.104) by ns1.primenet.com.au with SMTP; 29 Jul 2009 19:19:20 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 9575 invoked from network); 29 Jul 2009 19:19:14 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 29 Jul 2009 19:19:14 -0000 Received: (qmail 2701 invoked by alias); 29 Jul 2009 19:19:09 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 27199 Received: (qmail 2680 invoked from network); 29 Jul 2009 19:19:08 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 29 Jul 2009 19:19:08 -0000 Received: from mail-ew0-f221.google.com (mail-ew0-f221.google.com [209.85.219.221]) by bifrost.dotsrc.org (Postfix) with ESMTP id 937E580590F8 for ; Wed, 29 Jul 2009 21:19:05 +0200 (CEST) Received: by ewy21 with SMTP id 21so220856ewy.45 for ; Wed, 29 Jul 2009 12:19:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=DpEKrUgPCakFBCgiQZyZxKBZaFKHNkiiSmm65sAvU3I=; b=s7Ke+8/XVeaaPpPsesE2sRrrDxAJxdBRl8qePMUee3VDtTTLCn9KIW98/MgIBTH9Je W0aFI4ul3E2PT5SxMoHakUxdw36GfOwkV1WAepTPvB8+3zH1+uI4xv0bf2CGQLcsPhNF x+FIghHhFnvnqugRFchQzPMpcw9Zd60K0KhAo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=pqcalDwU5ksh8Kp/mP1uxWPTlsB7Yb29xUgiKjAVrtqSEuoA1TPoo+w/gjwUSANAWy JoNaUF3S8FfM02MUI3tqZTJGUAhb5oMbK0XYOyh4vHjGejcDfiQ+gjrMFSrgVNprP4gE NMtv+FtDYu1zi0u4s1+U4ywG8bFEhk9R9hT9E= MIME-Version: 1.0 Received: by 10.210.113.19 with SMTP id l19mr483432ebc.3.1248895144568; Wed, 29 Jul 2009 12:19:04 -0700 (PDT) Date: Wed, 29 Jul 2009 21:19:03 +0200 Message-ID: <237967ef0907291219m2cce3c52p2043dfc3d64c8cc8@mail.gmail.com> Subject: coprocess file descriptor p isn't closed after coprocess exits From: Mikael Magnusson To: zsh-workers Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.94.2/9632/Wed Jul 29 16:48:04 2009 on bifrost X-Virus-Status: Clean The commit message for the read -q fix mentioned read -p, so i did read - to see the description and didn't see anything. Turns out it only completes -p if you have a coproc open since -p reads from the coprocess. However, after you kill the coprocess it still completes -p. This made me a bit suspicious and i played around with >&p (which the completer uses to test if there is a coprocess). % zsh -f; echo oops: $? % true >&p zsh: coprocess: bad file descriptor % echo >&p zsh: coprocess: bad file descriptor % coproc true [1] 5794 % [1] + done true % true >&p && echo $? 0 % echo >&p && echo $? oops: 141 I've tried this on 4.3.5 and fairly recent zsh cvs. [ doing trap 'echo oops i got a sigpipe' PIPE gives an amusing (and ctrl-c-able) loop of echo: write error: broken pipe zsh: write error: broken pipe ] I couldn't figure out any syntax for closing the p descriptor manually like you would do with exec 2>&- p>&- obviously just tries to run the command 'p'. -- Mikael Magnusson