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

Re: Signal handling/zcurses



On Apr 21,  8:07pm, Bart Schaefer wrote:
}
} Interestingly, I'm able to reproduce your result with the script you
} sent -- in spite of the fact that (a) Linux normally has restartable
} system calls (b) the doc says that "Under the ncurses implementation,
} handled signals never interrupt getch" and (c) my zsh is linked with
} -lncursesw so this really should work.

This gets odder.

If you interrupt "zcurses input" with a handled signal, wget_wch() [and
I must assume wgetch()] returns ERR/EINTR.  The loop in my patch then
calls it again and gets ERR/zero, which causes "zcurses input" to
return 1.

Run "zcurses input" again immediately, and it again gets ERR/zero
without ever calling read().

Run it *again* and not only does wget_wch() block waiting for input,
but now it restarts properly after a handled signal!  Give it some
input so it returns success and the script-level loop in the test goes
around and wget_wch() is called a fifth time, and now it has returned
to the state where it gets interrupted by handled signals.

I was trying all this inside of GDB so I suppose that might have side-
effects, but this is damned peculiar.



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