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 <t...@sss.pgh.pa.us> wrote: > Thomas Munro <thomas.mu...@gmail.com> writes: > > On Sun, Apr 14, 2024 at 11:49 AM Tom Lane <t...@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 >