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.
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