Re: psql and readline

Поиск
Список
Период
Сортировка
От Ross J. Reedstrom
Тема Re: psql and readline
Дата
Msg-id 20030109224620.GB30740@wallace.ece.rice.edu
обсуждение исходный текст
Ответ на Re: psql and readline  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
On Thu, Jan 09, 2003 at 10:49:33PM +0100, Peter Eisentraut wrote:
> Christopher Kings-Lynne writes:
> 
> > Is there any way of making the 'up' arrow retrieve all of the last multiline
> > query, instead of just the last line?
> 
> There is nothing technical that should prevent you from implementing it.
> But you need to come up with a reasonable system to keep the history
> straight if meta commands are mixed with multiline commands, such as
> 
> select *
> \x
> from foo;

Peter, what do you think about pushing the query buffer onto the history
stack at execution time, any time it's a multiline query? That way,
after the above sequence, you'd have:

(1) select *
(2) \x
(3) from foo;
(4) select *    from foo;

Yeah, this wastes a history slot, but it does solve the problem. It's also
dead simple to code. ;-)

BTW, the behavior in bash for multiline interactive entered commands
is to concatenate them into a single line and dump them in the history,
replacing the individual parts.  The individual parts are in the history
while you're at the secondary prompt, then go away after execution. In
psql, we'd probably just lose interstitial metacommands.

Ross


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Dann Corbit"
Дата:
Сообщение: Re: Dollar in identifiers
Следующее
От: Jan Wieck
Дата:
Сообщение: Re: Dollar in identifiers