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

Replace ENTER with SHIFT-ENTER for sending a message to the llm. Use ENTER for new lines. #1502

Open
Emasoft opened this issue Oct 25, 2024 · 9 comments
Labels
Enhancement New feature or request

Comments

@Emasoft
Copy link

Emasoft commented Oct 25, 2024

Is your feature request related to a problem? Please describe.

Currently we cannot write code longer than one line or paste some code snippets without triggering the message to be sent one line at time. Replacing ENTER with SHIFT-ENTER solves the issue. It also make more difficult to send a message by accident.

Describe the solution you'd like

Replace ENTER with SHIFT-ENTER for sending a message to the llm. Use ENTER for new lines.

Describe alternatives you've considered

You can integrate in the terminal a multiline editor, like Textual. But this is a more complex solution.

Additional context

No response

@QUAGZA
Copy link
Contributor

QUAGZA commented Oct 27, 2024

Wouldn't it be easier to just assign shift enter to new line? Which most applications conventionally do

@Notnaton
Copy link
Collaborator

Notnaton commented Oct 27, 2024

Wouldn't it be easier to just assign shift enter to new line? Which most applications conventionally do

I agree with this
Might implement this next week

@Manamama
Copy link

Yes, keep Enter as SEND, and e.g. Shift+Enter for newlines.

@Emasoft
Copy link
Author

Emasoft commented Oct 30, 2024

No, because if I PASTE a text with few lines of code, only the first one is sent, then it returns, leaving out all the remaining lines of code.
This is why SHIFT+ENTER is the best choice to send.
ENTER should simply add a line break without sending.

@Manamama
Copy link

Manamama commented Oct 30, 2024

True. But:

  1. I resolve your situation with "Use cat to read file x.txt and act on it", with that file having whatever one wants, even hidden codes.
  2. Too onerous to press Shift+Enter each time; folks would abandon it due to user fatigue.

@Emasoft
Copy link
Author

Emasoft commented Oct 30, 2024

Let the thing be configurable. Users that find it onerous should only change a setting from true to false.
And regarding the suggestion to use cat and read a file... are you joking? Are you really suggesting that we should create a text file, write the code in it, and call the cat to read it asking the llm to read the output, every time we need to paste a snippet from, for example, stackoverflow? I just need one command to paste while I’m writing, why instead I should go through all those steps? It is ridiculous. Are you trying to make everybody's life harder?

@MikeBirdTech
Copy link
Contributor

@Emasoft no need for the harshness. All suggestions are welcome and everybody's workflow is different.

I like the idea of a configurable option and I'll raise it with the team. If you want to make a PR for it, I'd be happy to review it

@QUAGZA
Copy link
Contributor

QUAGZA commented Oct 31, 2024

Customizable key binds are also a good idea, and speaking of reading from a file it might come in handy if you have to run a script frequently you can make Open Interpreter read it from a saved file. Also speaking of copy-pasting commands we can make it so that the given prompt doesn't execute as long as we don't hit enter.

@MikeBirdTech MikeBirdTech added the Enhancement New feature or request label Nov 4, 2024
@KillianLucas
Copy link
Collaborator

KillianLucas commented Nov 4, 2024

I think we can have a more clear alternative which suggests the user type """ to start a multiline prompt, inspired by Ollama:

Screenshot 2024-11-04 at 9 16 57 AM

This is super friendly to large code blocks being pasted:

Screenshot 2024-11-04 at 9 17 12 AM

Thoughts? This won't require any mucking about with input monitoring (I tried to get a shift enter functionality working, but kept running into that) and I think Ollama has proven that this is a popular approach.

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

No branches or pull requests

6 participants