Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
XTRACE output -- I thought we'd fixed this?
- X-seq: zsh-workers 29301
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: XTRACE output -- I thought we'd fixed this?
- Date: Mon, 16 May 2011 14:28:43 -0700
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
bash-3.2$ set -x
bash-3.2$ echo hello 2>/dev/null
+ echo hello
hello
bash-3.2$
torch% set -x
torch% echo hello 2>/dev/null
hello
torch% echo hello
+Src/zsh:3> echo hello
hello
torch%
Stderr redirection isn't supposed to redirect the xtrace descriptor unless
you use a { ... } construct. There's even this in exec.c:execcmd():
/* Make a copy of stderr for xtrace output before redirecting */
fflush(xtrerr);
if (isset(XTRACE) && xtrerr == stderr &&
(type < WC_SUBSH || type == WC_TIMED)) {
if ((newxtrerr = fdopen(movefd(dup(fileno(stderr))), "w"))) {
xtrerr = newxtrerr;
fdtable[fileno(xtrerr)] = FDT_XTRACE;
}
}
Yet E02xtrace.ztst appears to expect this (wrong?) behavior, so I must be
mis-remembering something.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author