Re: Question about Ctrl-C and less

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Question about Ctrl-C and less
Дата
Msg-id 20051016185434.GI5779@svana.org
обсуждение исходный текст
Ответ на Re: Question about Ctrl-C and less  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Question about Ctrl-C and less  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-hackers
On Sun, Oct 16, 2005 at 02:44:41PM -0400, Tom Lane wrote:
> Martijn van Oosterhout <kleptog@svana.org> writes:
> > 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?
>
> I guess everybody else uses "q" not control-C to get out of less ;-)

Umm, Ctrl-C doesn't quit less, it aborts the current command. So if
it's doing a search or you've hit "F" (follow) or any number of other
things then the only way out is to press Ctrl-C. You have to press "q"
to quit less like you say.

> I'm not sure I agree with the concept of blocking SIGINT in this context
> --- you would not, I trust, propose blocking SIGQUIT or SIGHUP, but then
> why is it ok to block SIGINT?

The system() function blocks -INT and -QUIT, as does the shell when you
run a program, so why not?

> AFAICT it wouldn't fix the problem anyway, as there's still a bug in
> less: it doesn't restore the terminal settings on exit.

The point is, less is still running but psql it pulling the keystrokes
from under it... When you finally quit less it does restore the
settings, but now readline doesn't expect that as it's changed them
again...

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.

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Question about Ctrl-C and less
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: Question about Ctrl-C and less