On Thu, Oct 20, 2005 at 08:11:14PM -0400, mark@mark.mielke.cc wrote:
> I disagree that psql should make *any* assumptions about what SIGINT
> means to the child process. Consider less again, and Control-C used
> to abort a search. You are suggesting that Control-C should not only
> abort the search, but should also cut off the input from less. Less
> won't die. Less will just see a terminated input stream. What has been
> gained from this? Is this intuitive behaviour?
I must say I agree with the idea that Ctrl-C shouldn't stop the stream
from psql, but I'm willing to let it slide because a lot of other
programs work this way. I imagine asking it to be configurable will
meet even more resistance.
> I think the only reasonable behaviour is to ignore SIGINT within the
> parent, until the child exits. I don't see why other behaviours are
> even being considered. To me, it points at a misunderstanding of the
> problem.
I've been playing with a version of psql which on Ctrl-C doesn't
longjmp() but politely frees everything, waits for the pager and then
back to the main loop with the message "Interrupted". But now we have
another behaviour change: How to abort the gets() when you don't have
readline?
Doing it with a flag is a lot more susceptable to subtle behaviour
changes, but I'll see if I can make it work.
Have a nice day,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.