Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: strange behavior
On 2011-04-11 16:26:18 +0200, Vincent Lefevre wrote:
> On 2011-01-30 14:25:40 -0800, Bart Schaefer wrote:
> > Possible epiphany: zsh prints "zsh: exit 141" like that only if the
> > exit status came from a builtin or shell function (Src/exec.c). For
> > all external commands or subshells it appends the jobtext after the
> > status number (Src/jobs.c). Those are the only PRINTEXITVALUE cases.
> >
> > Thus the exit value of 141 must be coming from one of these places:
> >
> > (1) "read" builtin in the inner loop of "filter"
> > (2) "printf" in the ?* branch of the case in "filter"
> > (3) "echo" in the { ... } expression
>
> I can reproduce the SIGPIPE problem when resizing the terminal window
> while the wrapper is being run. According to strace, it's (3).
and this is because the SIGWINCH seems to interrupt the "read"
(is it a bug?), so that
while read -r $timeout -k -u 0 ch
do
line="$line$ch"
[[ $ch = $'\012' ]] && break
timeout=(-t 0.1)
done
gives an empty string; hence the observed behavior.
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author