Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Zargs bug



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