zsh-workers
 help / color / mirror / code / Atom feed
From: Aryn Starr <whereislelouch@icloud.com>
To: Stephane Chazelas <stephane.chazelas@gmail.com>
Cc: zsh-workers@zsh.org
Subject: Re: Zargs bug
Date: Wed, 3 Jul 2019 22:57:48 +0430	[thread overview]
Message-ID: <4107D202-9060-4387-89B6-AB41B27F1F3F@icloud.com> (raw)
In-Reply-To: <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@gmail.com> 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


      reply	other threads:[~2019-07-03 18:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-03 17:38 Aryn Starr
2019-07-03 18:05 ` Stephane Chazelas
2019-07-03 18:27   ` Aryn Starr [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4107D202-9060-4387-89B6-AB41B27F1F3F@icloud.com \
    --to=whereislelouch@icloud.com \
    --cc=stephane.chazelas@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).