linenoise-ng icon indicating copy to clipboard operation
linenoise-ng copied to clipboard

restore ctrl-enter functionality

Open Laeeth opened this issue 9 years ago • 6 comments

Hi.

This is unpolished (although suits my own purposes) but I thought you might want to consider restoring the ctrl-enter functionality for entering multi-line entries. At the moment I think you are missing one function from the original API: linenoiseSetMultiLine - which may become more useful again if this feature is restored.

The other suggestion is allowing user to press a defined key (maybe F2 as a default) to have enter just map to new line in the buffer and shift-enter complete the entry. useful for a REPL to be able to copy and paste multi-line code (I am using with Lua).

Laeeth avatar Jan 06 '16 04:01 Laeeth

I think we're generally happy to accept the patch, but for legal reasons we need you to fill out and sign our Contributor Agreement. You can scan and email the pdf file to [email protected] or send it via fax to +49-221-2722999-88. Sorry for the inconvenience, but once the agreement is there I can merge the PR and adjust the failing Windows build.

I have also added the missing linenoiseSetMultiLine function in linenoise-ng though it is there for API-compatibility only. It will do nothing, as the input in linenoise-ng is always multi-line. Regarding the special input mode that ignores the enter key: sounds good, too!

jsteemann avatar Jan 06 '16 10:01 jsteemann

Hi.

Thanks for writing back. I understand the environment we are in. I will get that back to you but it may be a little while.

I haven't written the special input mode yet but will look at when time.

Separate to that, can you think of another way one can copy and paste code into a single entry ?

The other thing is another guy has a password entry mode with stars. Might be nice to have.

On 6 January 2016 10:21:52 GMT+00:00, Jan [email protected] wrote:

I think we're generally happy to accept the patch, but for legal reasons we need you to fill out and sign our Contributor Agreement. You can scan and email the pdf file to [email protected] or send it via fax to +49-221-2722999-88. Sorry for the inconvenience, but once the agreement is there I can merge the PR and adjust the failing Windows build.

I have also added the missing linenoiseSetMultiLine function in linenoise-ng though it is there for API-compatibility only. It will do nothing, as the input in linenoise-ng is always multi-line. Regarding the special input mode that ignores the enter key: sounds good, too!


Reply to this email directly or view it on GitHub: https://github.com/arangodb/linenoise-ng/pull/1#issuecomment-169285684

Sent from my Android device with K-9 Mail. Please excuse my brevity.

Laeeth avatar Jan 06 '16 11:01 Laeeth

@Laeeth thanks a lot for your fix. Can you sign a contributor licence agreement available at https://www.arangodb.com/documents/cla.pdf?

fceller avatar Mar 02 '17 12:03 fceller

@Laeeth the intended behavior is, that a new line is added to the input. What should happen if I press CTRL-J within a line? Currently

linenoise> aaabbb

If the cursor is inbetween aaa and bbb then I end up with

linenoise> aaa
bbb                  X

where X marks the cursor. Is that intended?

fceller avatar Mar 29 '17 12:03 fceller

Hi. Sorry it's taken me so long to fill out the form. I haven't time to work on this at the moment - if you would like to fix behaviour so it works as expected, very happy for you to take this little suggestion over. Otherwise might take me a little while...

Laeeth avatar Mar 29 '17 13:03 Laeeth

No worries, this is an open source project and we all have other projects for which we are paid. I'll will have a look in the next days.

fceller avatar Mar 29 '17 13:03 fceller