public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: Tomas Vondra <[email protected]>
Cc: [email protected]
Subject: Re: libedit history seems to be misbehaving / broken
Date: Sun, 27 Oct 2024 15:03:06 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

Tomas Vondra <[email protected]> writes:
> I'm not terribly familiar with libedit, so can't say if it's a bug in
> libedit, or if we're just using it wrong in some way. I investigated
> that while on a flight from pgconf.eu, but can't look into this further.
> So let me at least share the behavior I observed, and what I found.
> Note: All of this is with libedit-3.1-53.20240808cvs.fc40.x86_64, which
> is what I currently get in Fedora 40.

libedit has been a hot mess for a long time.  psql's input.c has
workarounds for assorted bugs that it has or had in prior versions,
and what I suspect is that latest libedit has a different set of bugs.

FWIW, I don't observe any particular misbehavior with the very ancient
libedit that macOS ships.  On Fedora 39, I notice something related to
what you say: it seems like the "\q" ending a session gets repeated
into .psql_history by the next session.  I'm surprised that it's not
exactly the same as your results though, because it seems to be the
same source version:

$ rpm -q libedit
libedit-3.1-53.20240808cvs.fc39.x86_64

Didn't try the too-many-lines behavior, but it looks like that
is implemented totally by history_truncate_file(), so if that's
busted it's surely their fault.

			regards, tom lane






view thread (2+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: libedit history seems to be misbehaving / broken
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox