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

Re: Feature request: ZSH_XTRACEFD variable



2019-05-17 15:08:57 +0000, Timothée Mazzucotelli:
> Similar to Bash (BASH_XTRACEFD), I would like to be able to
> change the file descriptor to which the XTRACE output is sent.
[...]

I second that.

There are several cases where xtrace is not usable without
such a feature, like when a script does var=$(myfunction 2>&1).

env BASH_XTRACEFD=7 7> debug.log SHELLOPTS=xtrace bash some-cmd

Is something I use often for debugging. I sometimes even go all
the trouble of changing /bin/sh to a symlink to bash just for
that.

Being able to use zsh instead (with its much more powerful $PS4
customisation) would be very handy.

The zsh equivalent of bash's SHELLOPTS can be achieved with
~/.zshenv. I'm not suggesting zsh should add a SHELLOPTS
equivalent as it's quite dangerous a feature.

-- 
Stephane



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