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 1m3MYP-0008B5-2j for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Jul 2021 17:50:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m3MYO-0001yr-2Z for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Jul 2021 17:50:44 +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 1m3MYN-0001yj-Qu for pgsql-hackers@lists.postgresql.org; Tue, 13 Jul 2021 17:50:43 +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 1m3MYK-0000rN-Cw for pgsql-hackers@postgresql.org; Tue, 13 Jul 2021 17:50:43 +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 16DHocUb3278794; Tue, 13 Jul 2021 13:50:38 -0400 From: Tom Lane To: Thomas Munro cc: Pavel Stehule , vignesh C , PostgreSQL Hackers Subject: Re: proposal - psql - use pager for \watch command In-reply-to: References: Comments: In-reply-to Thomas Munro message dated "Tue, 13 Jul 2021 12:01:15 +1200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3278792.1626198638.1@sss.pgh.pa.us> Date: Tue, 13 Jul 2021 13:50:38 -0400 Message-ID: <3278793.1626198638@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Thomas Munro writes: > Pushed, after retesting on macOS (with the fixed pspg that has by now > arrived in MacPorts), FreeBSD and Linux. Thanks! After playing with this along the way to fixing the sigwait issues, I have a gripe/suggestion. If I hit control-C while the thing is waiting between queries, eg regression=# select now() \watch Tue Jul 13 13:44:44 2021 (every 2s) now ------------------------------- 2021-07-13 13:44:44.396565-04 (1 row) Tue Jul 13 13:44:46 2021 (every 2s) now ------------------------------- 2021-07-13 13:44:46.396572-04 (1 row) ^Cregression=# then as you can see I get nothing but the "^C" echo before the next psql prompt. The problem with this is that now libreadline is misinformed about the cursor position, messing up any editing I might try to do on the next line of input. So I think it would be a good idea to have some explicit final output when the \watch command terminates, along the line of ... Tue Jul 13 13:44:46 2021 (every 2s) now ------------------------------- 2021-07-13 13:44:46.396572-04 (1 row) ^C\watch cancelled regression=# This strikes me as a usability improvement even without the readline-confusion angle. regards, tom lane