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

Re: [buglet] Ctrl+C and 'kill -s INT $$' should produce exit status 130



Martijn Dekker wrote on Tue, Sep 20, 2016 at 14:17:08 +0100:
> On an interactive shell, sending SIGINT to the shell (which could be
> done with 'kill -s INT $$' or simply by pressing Ctrl+C) causes zsh to
> return to the command prompt with an exit status of 0, which represents
> a normal/successful exit. This should be 130, the exit status
> corresponding to SIGINT (128+2).
> 
> % while :; do :; done
> ^C%
> % echo $?                     # should produce 130
> 0
> % kill -s INT $$; echo oops   # no output produced, as expected
> % echo $?                     # should produce 130
> 0

What are the consequences of this?  Does it cause anything besides the
%? prompt escape, and printexitvalue, not reflecting the signal?

It only happens for builtins:
    while =true; do =true; done
gets it right but 
    while true; do true; done
does not.



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