Re: In MacOS, psql reacts on SIGINT in a strange fashion (Linux is fine)

Поиск
Список
Период
Сортировка
От Dmitry Koterov
Тема Re: In MacOS, psql reacts on SIGINT in a strange fashion (Linux is fine)
Дата
Msg-id CA+CZih5ck1-ZCvyM8a8GXzLb3e6D-EG27f2NTrBo49G5DF+mmA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: In MacOS, psql reacts on SIGINT in a strange fashion (Linux is fine)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Thanks to everyone!

I will file a bug.

Anyways, I just built a tool to work-around it all. It allows to run psql from processes which don't handle SIGINT in a proper shell-like manner (like yarn for instance): https://github.com/dimikot/run-in-separate-pgrp

Basically, without this, an attempt to run `yarn psql` and then pressing ^C kills yarn (it kills it in Linux too, since ^C propagates SIGINT to all processes in the foreground group), because yarn doesn't behave nicely with exit codes (and exit signals) of its child processes. With run-in-separate-pgrp wrapping, ^C is only delivered to psql.


On Sat, Apr 13, 2024 at 5:09 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Thomas Munro <thomas.munro@gmail.com> writes:
> On Sun, Apr 14, 2024 at 11:49 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> OK, I tried dtruss'ing psql on macOS.  What I see is that with
>> Apple's libedit, the response to SIGINT includes this:
>> kill(0, 2)               = 0 0

> https://github.com/NetBSD/src/blob/1de18f216411bce77e26740327b0782976a89965/lib/libedit/sig.c#L110

Ah, I was wondering if that was from upstream libedit or was an
Apple-ism.  Somebody should file a bug.

                        regards, tom lane

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

Предыдущее
От: "Wen Yi"
Дата:
Сообщение: Re: Things I don't like about \du's "Attributes" column
Следующее
От: David Rowley
Дата:
Сообщение: [MASSMAIL]SupportRequestRows support function for generate_series_timestamptz