Re: Getting psql to redisplay command after \e

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Getting psql to redisplay command after \e
Date: 2019-11-22 22:10:24
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

I wrote:
> Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr> writes:
>> This suggests that readline cannot be used to edit simply a known string?
>> :-( "rl_insert_text" looked promising, although probably not portable, and
>> I tried to make it work without much success anyway. Maybe I'll try to
>> investigate more deeply later.

> I think that rl_insert_text and friends can probably only be used from
> readline callback functions. So in principle maybe you could make it
> work by having an rl_startup_hook that injects text if there is any
> to inject. There would remain the issues of (a) is it portable across
> a wide range of readline and libedit versions, (b) will the prompting
> behavior be nice, and (c) do we really want this to work fundamentally
> differently when readline is turned off?

I thought maybe you were going to work on this right away, but since
you haven't, I went ahead and pushed what I had. There's certainly
plenty of time to reconsider if you find a better answer.

regards, tom lane

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Ranier Vilela 2019-11-22 22:10:29 RE: [PATCH] Tiny optmization.
Previous Message Tomas Vondra 2019-11-22 22:05:08 Re: [PATCH] Tiny optmization.