peff@peff.net wrote on Thu, 15 Dec 2011 08:39 -0500:
I agree it might be a little more obvious to put it there (I think what
happened is my initial revision did not look at "echo" ever again, and
then that conditional was added later when I realized that the "!echo"
case needed us to print the newline manually).
quoted
And why no sigchain_pop() for the signal handler?
Because I used sigchain_push_common, which has no pop_common analog. But
it's OK, because calling restore_term sets term_fd to -1, making further
calls a no-op. So leaving the handler in place is fine.
Another option would be to add sigchain_pop_common, which pops the
same signals from push_common.
Thanks for the detailed explanation. It was indeed the lack of
symmetry that set me off. I missed the term_fd check for both.
-- Pete