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

Multiline support? #32

Open
h3rald opened this issue Jul 29, 2023 · 2 comments
Open

Multiline support? #32

h3rald opened this issue Jul 29, 2023 · 2 comments

Comments

@h3rald
Copy link

h3rald commented Jul 29, 2023

First of all, good work on this library! One thing confuses me a little bit though: do you really support editing multiple lines?

I tried:

  • Entering text till the end of the line, and when the line wraps the text gets garbled
  • Pressing ENTER or SHIFT+ENTER accepts input

Is there any way to edit multiple lines? How?

@jangko
Copy link
Owner

jangko commented Jul 29, 2023

Yes, this library support editing multiple lines. but testing with various terminal is difficult. There might be some terminal that have different behavior.

@h3rald
Copy link
Author

h3rald commented Jul 29, 2023

I tried on linux and it seems to support line wrapping, yes.

On windows however, line wrapping doesn't really work: basically it seems to "copy" the previous line and it goes over it.

I was also wondering if this library supports/could support a sort of "new line callback" proc to intercept ENTER key and decide whether to actually print a new line (for example when entering some programming code and the number of parenthesis/delimiters don't match, so that it is possible to have dictionary/arrays entered on multiple lines) or accept input. This would also allow copying and pasting multiple lines into the terminal, and edit the whole text within the same prompt.

What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants