Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow EDITOR to be used for the current command in mclient #6931

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments
Closed

Allow EDITOR to be used for the current command in mclient #6931

monetdb-team opened this issue Nov 30, 2020 · 0 comments
Labels
Client interfaces enhancement New feature or request

Comments

@monetdb-team
Copy link

Date: 2020-07-20 12:02:31 +0200
From: Muhmud Ahmad <<muhmud.ahmad>>
To: clients devs <>
Version: 11.37.7 (Jun2020)
CC: @kutsurak, muhmud.ahmad

Last updated: 2020-10-19 11:06:21 +0200

Comment 27919

Date: 2020-07-20 12:02:31 +0200
From: Muhmud Ahmad <<muhmud.ahmad>>

Like the MySQL and PostgreSQL command line clients have \e to open the editor specified in $EDITOR to edit the current line.

Comment 27984

Date: 2020-08-16 17:58:04 +0200
From: Muhmud Ahmad <<muhmud.ahmad>>

Created attachment 689
Patch that implements the required functionality

Attached file: 0001-EDITOR-capability.patch (text/plain, 3644 bytes)
Description: Patch that implements the required functionality

Comment 28004

Date: 2020-08-21 17:58:46 +0200
From: @kutsurak

Hi and thanks very much for the patch!

We ended up implementing the feature in a different way, using the GNU readline library.

It is currently in the Oct2020 branch and will eventually (soon) land on default.

It works as follows:

You add some text in the mclient prompt and if you enter a specific keybind, Alt-e by default but the user can rebind this in ~/.inputrc (see the GNU Readline manual for details https://tiswww.case.edu/php/chet/readline/readline.htmlSEC9), the editor specified in VISUAL or EDITOR is started with the text you have already entered.

Edit, save the file and after you exit the editor, all the text contained in the file is copied in the mclient prompt and the cursor is transferred at the end of your input.

Comment 28005

Date: 2020-08-22 00:00:21 +0200
From: Muhmud Ahmad <<muhmud.ahmad>>

Sounds great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client interfaces enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants