Re: psql and readline - Mailing list pgsql-hackers

From Peter Mount
Subject Re: psql and readline
Date
Msg-id Pine.LNX.4.44.0301091518560.1613-100000@localhost.localdomain
Whole thread Raw
In response to Re: psql and readline  (Justin Clift <justin@postgresql.org>)
List 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@retep.org.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




pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: psql and readline
Next
From: "Dan Langille"
Date:
Subject: Re: psql and readline