Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mo7UZ-00029L-IM for pgsql-hackers@arkaria.postgresql.org; Fri, 19 Nov 2021 17:16:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mo7UY-0002ww-F5 for pgsql-hackers@arkaria.postgresql.org; Fri, 19 Nov 2021 17:16:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mo7UY-0002wn-5V for pgsql-hackers@lists.postgresql.org; Fri, 19 Nov 2021 17:16:02 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mo7UV-00018t-Vb for pgsql-hackers@lists.postgresql.org; Fri, 19 Nov 2021 17:16:01 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 1AJHFva43085405; Fri, 19 Nov 2021 12:15:57 -0500 From: Tom Lane To: "Bossart, Nathan" cc: "pgsql-hackers@lists.postgresql.org" Subject: Re: Improving psql's \password command In-reply-to: <450C0AD1-CF21-4056-A9EE-6201E9763FC9@amazon.com> References: <747443.1635536754@sss.pgh.pa.us> <765509.1635552418@sss.pgh.pa.us> <7BAC8A28-148B-4B03-A345-D68071388300@amazon.com> <1553329.1636647111@sss.pgh.pa.us> <1847699.1636747076@sss.pgh.pa.us> <2141902.1636999964@sss.pgh.pa.us> <5EDA38EF-C411-4C7D-A9BC-10B1D4584E5E@amazon.com> <2152988.1637010233@sss.pgh.pa.us> <2850852.1637194468@sss.pgh.pa.us> <450C0AD1-CF21-4056-A9EE-6201E9763FC9@amazon.com> Comments: In-reply-to "Bossart, Nathan" message dated "Fri, 19 Nov 2021 00:41:30 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3085403.1637342157.1@sss.pgh.pa.us> Date: Fri, 19 Nov 2021 12:15:57 -0500 Message-ID: <3085404.1637342157@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "Bossart, Nathan" writes: > Okay, here is an attempt at adding control-C support for \prompt and > \connect. It was reasonably straightforward. I did have to teach > simple_prompt_extended() to add a newline after a cancellation when > "echo" is true. LGTM, pushed after very minor fooling with the comments. > I think that's it for psql. After a quick glance, I didn't see any > other obvious candidates for control-C support, but I'll look a little > closer to be sure. Hmm, initdb's prompt-for-superuser-password might need it. I think the rest of our frontend programs don't trap SIGINT, or at least don't do so while requesting user input. regards, tom lane