Thread

  1. Re: psql and readline

    Peter Mount <peter@retep.org.uk> — 2003-01-09T15:22:46Z

    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