On Sun, May 16, 2021 at 9:15 AM Mikael Magnusson wrote: > > On 5/16/21, Bart Schaefer wrote: > > Specifically, the shell is interruptible by ^C. > > I just updated to latest git and I still can't ^C the "while do; > done". Curious. > > The attached makes both "while do" and "do done" into parse errors; > > I use "do done" in production code so you can't remove that. Let's try the attached, then? I don't immediately see any reason that the SIGINT handler should not always set errflag. > > Because we're still in the parser, none of (list_pipe || chline || > > simple_pline) is true, so we never set breaks or errflag, only > > lastval. I'm not immediately sure what to do about that; perhaps just > > move the errflag setting outside that test? However, setting errflag is not sufficient to actually interrupt the parse. The attached just causes the empty loop condition to fail when signaled. Which I suppose could mean there's still a race condition if the interrupt occurs during the empty loop body instead.