Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH2] Re: avoid closed stdin() in zle widgets
- X-seq: zsh-workers 41273
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Stephane Chazelas <stephane.chazelas@xxxxxxxxx>
- Subject: Re: [PATCH2] Re: avoid closed stdin() in zle widgets
- Date: Mon, 12 Jun 2017 14:34:49 +0000
- Cc: zsh-workers@xxxxxxx, Eric Cook <llua@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=hkhPE6 uPJjdNV2if89E6DRNcWdR9RQcvf9PKEVqsix4=; b=Lqn2PcQov4aprCr2cdYcdi zAtPpSnbXWy3y98b09IpcRvskUOjTIEcBLbGHmePVo96OgsD/Rx1f6D9QoIxV9X0 Zd2SfZcufFZ3WiPh0ZM+oDUSbu3tuXwKKMzsRzFeIZBDrCEeqdJp2eD5HbB+Z9ES XLebS5ci8LKtC7o2Qr1rzCdz6DU0CHXBHxryHgcL58Yky8DSpEXcPJRw3yfziUtl BeqYkDXI/El/v0zrgXEgPqw1N9DCqO4RhUA+klIOE6LiJFa4eIo7NkcJhKpmNF26 CQPKb/itR8yeJvVWAWhLCVYA36bT2MwQ+pyRrlsDGEuQPllw57a6iL8ZhelSdm/Q ==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=hkhPE6 uPJjdNV2if89E6DRNcWdR9RQcvf9PKEVqsix4=; b=U4NVQxsKGi/nmQsX6PVkU6 2MIMr9Lcq7Paj3ZRbZY8rDL5eDJCM+nKeW+035NssUNJ+1vjX3ecNrNVAsbZJ8fv 3H5AJo3jFYQ8zfe1JpsneCjNRIbO2vYsMDqVpvdemtvOfQ6bTn1U4g6DaM62hvVb kxLrFN2lt4CE3+IL9r/Oqzr1tdcBaU8IkcFg35Wfu8+chPpKOWhLgZPdJnpumgaG m16O/jPnkebgaSp5w7LM5dPlS6cT6dGDIvZetg7E69qC+qcvRBWqFQwxiriR8EEq EiD4HZQ2ePD5YMB9LJkT8w1IsDEvcbtmf05bFpqymWfCzTjsb/3MOMBPxRgeteUA ==
- In-reply-to: <20170612060554.GA4709@chaz.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20170611182045.GA5318@chaz.gmail.com> <d0c3e336-c186-a5c0-746c-d241a173c189@gmx.com> <20170612060554.GA4709@chaz.gmail.com>
Stephane Chazelas wrote on Mon, 12 Jun 2017 07:05 +0100:
> 2017-06-12 00:15:20 -0400, Eric Cook:
> [...]
> > > in zle widgets, stdin currently appears to be closed. That's
> > > generally not a good idea to close fds 0, 1, 2 as many commands
> > > are confused when the files they open suddenly become their
> > > stdin/stdout/stderr because the first free fd is 0/1/2.
> [...]
> > It is documented to work like that in zshzle
> [...]
>
> Well spotted. Thanks. (I also left a diff by mistake for an
> unrelated issue discussed earlier on. Sorry about that).
>
> New patch:
>
> diff --git a/Doc/Zsh/zle.yo b/Doc/Zsh/zle.yo
> index b65e3be..bd0252f 100644
> --- a/Doc/Zsh/zle.yo
> +++ b/Doc/Zsh/zle.yo
> @@ -750,12 +750,12 @@ sect(User-Defined Widgets)
Incompatible changes should be mentioned in NEWS or README.
I'm not convinced that the change should be made. Devil's advocate
argues that this is a bug in dircolors(1), so (a) as an immediate
workaround, people with a buggy dircolors(1) command should redirect
stdin from /dev/null when invoking it, (b) those people should fix their
dircolors(1) command to not assume fd 0 is open.
Daniel
Messages sorted by:
Reverse Date,
Date,
Thread,
Author