Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qipS8-007zae-Vq for pgsql-hackers@arkaria.postgresql.org; Wed, 20 Sep 2023 05:08:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qipS7-00ENOo-JA for pgsql-hackers@arkaria.postgresql.org; Wed, 20 Sep 2023 05:08:43 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qipS7-00ENOQ-8Z for pgsql-hackers@lists.postgresql.org; Wed, 20 Sep 2023 05:08:43 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qipS3-005ZBt-7m for pgsql-hackers@lists.postgresql.org; Wed, 20 Sep 2023 05:08:42 +0000 Received: from oss.nttdata.com (localhost [127.0.0.1]) by oss.nttdata.com (Postfix) with ESMTPA id 2AEB760830; Wed, 20 Sep 2023 14:08:34 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at oss.nttdata.com MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 20 Sep 2023 14:08:34 +0900 From: Ryoga Yoshida To: Michael Paquier Cc: Aleksander Alekseev , pgsql-hackers@lists.postgresql.org, Kyotaro Horiguchi Subject: Re: Bug fix for psql's meta-command \ev In-Reply-To: References: <01419622d84ef093fd4fe585520bf03c@oss.nttdata.com> <20230915.151750.1163612305682721014.horikyota.ntt@gmail.com> User-Agent: Roundcube Webmail/1.4.11 Message-ID: <0b87efc5a628fe4f1144c2d6879894dc@oss.nttdata.com> X-Sender: bt23yoshidar@oss.nttdata.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2023-09-20 09:32, Michael Paquier wrote: > Actually there was a bit more to it in the presence of \e, that could > also get some unpredictible behaviors if some errors happen while > editing a query, which is something unlikely, still leads to strange > behaviors on failure injections. I was considering first to move the > reset in do_edit(), but also we have the case of \e[v|f] where the > buffer has no edits so it felt a bit more natural to do that in the > upper layer like in this patch. Indeed, similar behaviours can happen with the \e. The patch you committed looks good to me. Thank you. Ryoga Yoshida