Re: Question about Ctrl-C and less - Mailing list pgsql-hackers

From mark@mark.mielke.cc
Subject Re: Question about Ctrl-C and less
Date
Msg-id 20051016214401.GA31246@mark.mielke.cc
Whole thread Raw
In response to Re: Question about Ctrl-C and less  (Josh Berkus <josh@agliodbs.com>)
List pgsql-hackers
On Sun, Oct 16, 2005 at 01:57:13PM -0700, Josh Berkus wrote:
> Martjin,
> > This problem has been around for ever yet obviously not everybody runs
> > into it all the time like I do. Would patch to fix this be accepted or
> > is there a reason why not?
> Actually, I run into it fairly often when I'm being hasty.  I'd imagine most 
> Linux-based newbies do as well.

I believe many such applications (including less?) are following the
Emacs tradition(?) of having Control-C, or often, Control-G (with
Control-G actually being re-bound as the interrupt character) - mean
interrupt the current operation within the application - not cause
the application to exit. If I wanted to quit, I'd hit 'q'. The times
I do hit Control-C, or Control-G, are when the application I believe
I am using (my keystrokes are interacting with) is performing a
lengthy operation, that I wish to interrupt.

One such operation that has come up with me in less, is when it is
attempting to calculate the line numbers. It becomes non-responsive
during this time, and if I don't care what the line number is, I
interrupt less to tell it 'no - don't calculate line numbers - get
ready for my next command'.

So, I'm with Martijn. It's not right for psql to die from SIGINT
during the execution of another command. SIGINT is a user signal
that can be generated from a keyboard. Psql should not be making
assumptions about what the signal is meant to mean, to the current
application in control of the keyboard.

I agree with Martijn on SIGQUIT (another keyboard signal!) being
ignored, but leaving SIGHUP (not a keyboard signal!) cause psql to
exit. SIGHUP is usually sent to everybody, with everybody paying
attention to it. SIGINT and SIGQUIT are intended for the application
in control of the terminal.

Cheers,
mark

-- 
mark@mielke.cc / markm@ncf.ca / markm@nortel.com     __________________________
.  .  _  ._  . .   .__    .  . ._. .__ .   . . .__  | Neighbourhood Coder
|\/| |_| |_| |/    |_     |\/|  |  |_  |   |/  |_   | 
|  | | | | \ | \   |__ .  |  | .|. |__ |__ | \ |__  | Ottawa, Ontario, Canada
 One ring to rule them all, one ring to find them, one ring to bring them all                      and in the darkness
bindthem...
 
                          http://mark.mielke.cc/



pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: A costing analysis tool
Next
From: Tom Lane
Date:
Subject: libpq's pollution of application namespace