Re: psql and readline

From: Peter Mount <peter(at)retep(dot)org(dot)uk>
To: Justin Clift <justin(at)postgresql(dot)org>
Cc: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: psql and readline
Date: 2003-01-09 15:22:46
Message-ID: Pine.LNX.4.44.0301091518560.1613-100000@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 10 Jan 2003, Justin Clift wrote:

> Bruce Momjian wrote:
> <snip>
> > Let's suppose I am writing a query, and then I do \e to edit the query,
> > and I exit the editor and return to psql. Suppose I decide I want to
> > reedit, so I up arrow. I would expect to get \e, not the query I just
> > edited, no?
>
> Wouldn't it depend on how this gets implemented?
>
> Maybe least negative impact approach (suggested already): If the "large
> command that was edited" is put in the command history before the \e,
> then both are available and there is no big change from "expected
> behaviour".
>
> i.e. one up arrow get the previous \e, and a second up arrow would bring
> up the command that was worked upon.

Yes, that would then not confuse things too much when someone expects \e
as that's the last thing they typed.

The main benefit I can see is when you have entered a large query, then a
smaller one (or another \ command), and want to re-run the large query.
Currently you could use the terminal's history and copy/paste it, but if
you edited the query with \e then that doesn't work (or worse if the
terminal doesn't support it, or it's scrolled off the top of the buffer).

Peter

--
Peter Mount
peter(at)retep(dot)org(dot)uk
http://www.retep.org.uk/
Tel/Fax: +44 (0) 1622 749439
Mobile: +44 (0) 7903 155887
US Fax: 1 435 304 5165
US Voice: 1 435 304 5165

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dan Langille 2003-01-09 15:24:29 Re: psql and readline
Previous Message Bruce Momjian 2003-01-09 15:13:14 Re: psql and readline