Re: Question about Ctrl-C and less

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: mark(at)mark(dot)mielke(dot)cc
Cc: Kevin Brown <kevin(at)sysexperts(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Question about Ctrl-C and less
Date: 2005-10-21 11:53:32
Message-ID: 20051021115331.GA29418@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Oct 20, 2005 at 08:11:14PM -0400, mark(at)mark(dot)mielke(dot)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(at)svana(dot)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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2005-10-21 12:17:10 Re: Seeing context switch storm with 10/13 snapshot of
Previous Message Wilkin, Kurt 2005-10-21 11:03:23 Re: [GENERAL] 'a' == 'a '