[PATCH] Add support to psql for edit-and-execute-command

Поиск
Список
Период
Сортировка
От Joe Wildish
Тема [PATCH] Add support to psql for edit-and-execute-command
Дата
Msg-id F2CCADF3-B70D-4821-B244-181F3C00FA6A@lateraljoin.com
обсуждение исходный текст
Ответы Re: [PATCH] Add support to psql for edit-and-execute-command  (Oleksandr Shulgin <oleksandr.shulgin@zalando.de>)
Список pgsql-hackers
Hi hackers,

Attached is a small patch for adding "edit-and-execute-command" readline 
support to psql. Bash has this concept and I miss it when using psql. It 
allows you to amend the current line in an editor by pressing "v" (when 
in vi mode) or "C-x C-e" (when in emacs mode). Those are the default 
bindings from bash although of course they can be amended in inputrc.

Most of the patch is actually shifting "do_edit" from "command.c" to 
"common.c". There is a small amendment to that function to allow vi to 
launch at the correct column offset.

I noticed that there is some logic in configure for detecting certain 
readline functions. I assume this is for compatibility sake with 
libedit/editline? Rather than testing for each rl_* function I hid the 
functionality behind HAVE_READLINE_READLINE_H .. don't know if this is 
acceptable?

-Joe
Вложения

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

Предыдущее
От: Pavel Borisov
Дата:
Сообщение: Re: [PATCH] fix GIN index search sometimes losing results
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: Parallel copy