Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: precmd: write error: interrupted
- X-seq: zsh-workers 31332
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx, "Yuri D'Elia" <wavexx@xxxxxxxxxxxxxxxxxxxxx>, zsh-users@xxxxxxx
- Subject: Re: precmd: write error: interrupted
- Date: Thu, 25 Apr 2013 17:53:41 -0700
- In-reply-to: <klc0n1$34u$1@ger.gmane.org>
- 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
- References: <klbmnc$ieh$1@ger.gmane.org> <130425111646.ZM17258@torch.brasslantern.com> <klc0n1$34u$1@ger.gmane.org>
(Redirecting this to -workers, so Yuri Cc'd in case he's only on -users)
On Apr 25, 9:38pm, Yuri D'Elia wrote:
}
} precmd() { { print x } 2>/dev/null }
}
} still doesn't suppress the error.
Interesting! Something is restoring the stderr descriptors before the
error message in bin_print is written. Here is a bit of strace from
'zsh -f' with { print -n $'x\r' } 2>/devnull running in a loop on the
command line (not from a precmd):
open("/dev/null", O_WRONLY|O_CREAT|O_NOCTTY|O_TRUNC|O_LARGEFILE, 0666) = 3
dup2(3, 2) = 2
write(1, "x\r", 2) = ? ERESTARTSYS (To be restarted)
--- SIGWINCH (Window changed) @ 0 (0) ---
dup2(12, 2) = 2
dup2(11, 2) = 2
write(10, "\33[1m\33[7m%\33[27m\33[1m\33[0m
\r \r", 105) = 105
write(2, "print: write error: interrupt\n", 30) = 30
Those dup2 calls should happen only at the end of execcmd after bin_print
has already returned, but somehow they appear to be happening after the
signal handler is called but before the error message.
Attaching with a debugger blocks the interrupt so I haven't been able to
stack-trace the source of the dup2 calls.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author