Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Zargs bug
- X-seq: zsh-workers 44490
- From: Aryn Starr <whereislelouch@xxxxxxxxxx>
- To: Stephane Chazelas <stephane.chazelas@xxxxxxxxx>
- Subject: Re: Zargs bug
- Date: Wed, 3 Jul 2019 22:57:48 +0430
- Cc: zsh-workers@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=04042017; t=1562178472; bh=rHEE3m1oXFHqI+N+jyZwWacJR6+4o/GMTXQLR/ZMQs4=; h=Content-Type:Subject:From:Date:Message-Id:To; b=c9K3Ezbo1t0S86M+IurDwPteSRWs5qdOYQ9SXa2pCx1bGosR7Ng3aGDgXCnev4jIS G7dKWs9IW9HaOH9lr5SJq0CuZaHCIwxQoZWHWElSxYGmy6l/NWZd76RkL67bgNWPiC fJCi+megw6Qf114OLLY0MiW0t/l0+vYlWRWCdaSqg1SI10XuILOamjcP9+4tsXkVAB dny+dCY2OOnuHPGblxJ5ebcCUiQpwRYjxqjTDrZS+7KV00nITfu/pP3HQDiyPhQNLA hhvy6plrjlTux0Jm0THDJlmoZLLjDJGW5pl1SPdjXUfe46oB6hDnB7iusE7MVfe2C8 FvniMo3MII2iw==
- In-reply-to: <20190703180558.tq7hwgrtajgq35ds@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>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <F49F336B-CAA1-4992-B7EF-E6D04763CF4E@icloud.com> <20190703180558.tq7hwgrtajgq35ds@chaz.gmail.com>
I suggest adding an option flag for not using the subshell if it’s easy to do so.
I currently reimplemented this application with this function:
rexa () {
local i
for i in "${@:2}"
do
eval "$(sed -e "s/_/${i:q:q}/g" <<< "$1")"
done
}
It seems to be working.
> On Jul 3, 2019, at 10:35 PM, Stephane Chazelas <stephane.chazelas@xxxxxxxxx> wrote:
>
> 2019-07-03 22:08:04 +0430, Aryn Starr:
>> I run this line:
>>
>> $ zargs -t -i _ -- ceer whh -- compdef _=which
>> compdef ceer=which
>> compdef whh=which
>>
>> But the completions don’t activate. When I manually run
>> ‘compdef ceer=which’, though, it works flawlessly.
> [...]
>
> zargs runs the commands in a subshell, so they can't affect the
> current shell environment.
>
> Same as if you'd run:
>
> (compdef ceer=which)
>
> AFAICT, it's not documented but the code of zargs has:
>
> # Everything has to be in a subshell just in case of backgrounding jobs,
> # so that we don't unintentionally "wait" for jobs of the parent shell.
>
> --
> Stephane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author