Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Feature request: ZSH_XTRACEFD variable
- X-seq: zsh-workers 45765
- From: Stephane Chazelas <stephane@xxxxxxxxxxxx>
- To: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- Subject: Re: Feature request: ZSH_XTRACEFD variable
- Date: Sun, 3 May 2020 07:01:13 +0100
- Cc: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, Timothée Mazzucotelli <timothee.mazzucotelli@xxxxxxxxx>, Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>, "zsh-workers@xxxxxxx" <zsh-workers@xxxxxxx>
- In-reply-to: <20200503000658.6fddb904@tarpaulin.shahaf.local2>
- 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>
- Mail-followup-to: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, Timothée Mazzucotelli <timothee.mazzucotelli@xxxxxxxxx>, Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>, "zsh-workers@xxxxxxx" <zsh-workers@xxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CGME20190721150914epcas1p18b5b4b9ccc4e593e854b076a835257c7@epcas1p1.samsung.com> <CAD8ZDTrfrWTKfa1efTo63uk1XJO4BOp5hSLOfjL1tXkeDMf_QQ@mail.gmail.com> <1563722540.4311.24.camel@samsung.com> <CAD8ZDTokqOTfEajquX2SKU5pLWgd85sPdRMYkxE4nF0pQhi+BA@mail.gmail.com> <1565710707.5633.11.camel@samsung.com> <CAD8ZDTotCLBANtzppSbCcgKyLhkXaVWysjqv99xS6bnLypBViA@mail.gmail.com> <309829031.4459446.1587391766024@mail2.virginmedia.com> <CAD8ZDTp=rYsWiEkq3byjU=BRAA2iLwxt5QG_19MBc+Jo8dC-0w@mail.gmail.com> <CAH+w=7Ymtz4XH708BGvgwo89WNB=HttfyX+fHVHakz+Ybf==ag@mail.gmail.com> <20200503000658.6fddb904@tarpaulin.shahaf.local2>
2020-05-03 00:06:58 +0000, Daniel Shahaf:
[...]
> P.S. Shouldn't ZSH_XTRACEFD be declared with PM_DONTIMPORT?
(assuming PM_DONTIMPORT is about not importing it from the
environment)
ZSH_XTRACEFD is useful in things like:
ZSH_XTRACEFD=7 zsh -x myscript 7> somefile
Or
ZSH_XTRACEFD=7 zsh -lx 7> somefile
to debug start-up file issues.
That's the primary way I've been using its bash counterpart.
See
https://unix.stackexchange.com/search?q=user%3A22565+BASH_XTRACEFD
for several examples.
bash also allows
SHELLOPTS=xtrace BASH_XTRACEFD=7 some-command
Which will cause all bash invocations run through some-command
(including those running as sh!) to have their xtrace option
set. I've used that to debug things like grub-install.
I don't think we want to go there with zsh. With zsh, one can
always add a:
if [[ -n $MYDEBUG ]]; then
ZSH_XTRACEFD=7
set -o xtrace
fi
to their ~/.zshenv to enable this kind of debugging.
--
Stephane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author