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

Re: Feature request: ZSH_XTRACEFD variable



2020-05-03 07:01:13 +0100, Stephane Chazelas:
[...]
> SHELLOPTS=xtrace BASH_XTRACEFD=7 some-command
[...]
> I don't think we want to go there with zsh.
[...]

I meant: we probably don't want to have options set via the
environment like with bash's SHELLOPTS and BASHOPTS, as that's
quite dangerous and does cause quite a few problems with bash

See for instance:

$ (SHELLOPTS= exec -a sh bash -c 'bash -c "printenv SHELLOPTS"')
braceexpand:hashall:interactive-comments:posix

See how all those POSIX compliance options have been enabled for
*all* bash invocations, just because bash was invoked as sh in
an environment with a SHELLOPTS variable.

But for ZSH_XTRACEFD, IMO it makes sense to import it as we do
already import PS4.

Note that BASHOPTS, SHELLOPTS and PS4 are in sudo's env var
blacklist, but BASH_XTRACEFD is not (maybe it should)

-- 
Stephane



Messages sorted by: Reverse Date, Date, Thread, Author