Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
coprocess file descriptor p isn't closed after coprocess exits
- X-seq: zsh-workers 27199
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-workers <zsh-workers@xxxxxxxxxx>
- Subject: coprocess file descriptor p isn't closed after coprocess exits
- Date: Wed, 29 Jul 2009 21:19:03 +0200
- 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=
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
The commit message for the read -q fix mentioned read -p, so i did
read -<tab> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author