Re: Question about Ctrl-C and less

Поиск
Список
Период
Сортировка
От Sean Utt
Тема Re: Question about Ctrl-C and less
Дата
Msg-id 012401c5d752$6512fb00$0201a8c0@randomnoise
обсуждение исходный текст
Ответ на Re: Question about Ctrl-C and less  (Andrew Dunstan <andrew@dunslane.net>)
Ответы Re: Question about Ctrl-C and less  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-hackers
> It won't work properly that way.  SIGINT gets sent to all the members
> of the process group, not just the child.  Psql isn't responsible for
> sending ctrl-c through to the child.



Except that if I am in less, and I do CONTROL-C, it doesn't do anything at 
all.

It doesn't exit.

If I send a kill -2 to the process, it doesn't exit. less ignores SIGINT 
completely.

So, whether or not they are working together in cooperation, the result we 
have been seeing when typing CONTROL-C is completely under the control of 
psql.

I do realize that the problem is one of when and how to cancel the query if 
CONTROL-C is pressed.
If the query is still building and the output hasn't, or won't be, sent to 
the pager, cancel the query.
If we are in the pager, don't respond to CONTROL-C, and instead output a 
helpful hint telling people to use q to quit, which will do what they really 
wanted anyway.
In theory, we already deal gracefully with q being pressed in the pager.

Sean





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

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Query Progress Estimator
Следующее
От: Thomas Hallgren
Дата:
Сообщение: Re: Lifecycle management