-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 multiline prompts #1279
Allow multiline prompts #1279
Conversation
I was spending way too much time on this, but yeah, there is no nice way to do that. For some reason it's not easy to reliably log CTRL+Enter info. You could use the Maybe the best solution is to just have a special keyword to stop parsing. The way I updated it is that if you enter Not sure how to move forward with this. What do you think here @carmocca and @awaelchli , should we just leave it as is, use |
I'm good with whatever the solution if it does not impact the single-line user experience. However, keep in mind that if you add special syntax for the multi-line input, it won't solve your original issue #1275 where you copy-pasted multi-line into the terminal. |
Ok, thinking about this more, I think there is no one-size-fits-all approach. So, I changed it back so that by default nothing changes. But you can now additionally pass the
to work with multiline prompts. This will then require users to enter This should also address #1275 based on trying it. The code should be ready for review @carmocca and @awaelchli . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some tests are failing
All the feedback should be addressed now. Thanks @carmocca @awaelchli for keeping the bar high! The default usage is the same as before, except that you can now exit via
And with
|
Co-authored-by: Carlos Mocholí <[email protected]>
This workaround let's users submit multiline prompts. Either via copy & paste or by typing on the command line and using Enter once to start a new line. If the newline is blank and a user hits Enter again, it submits the prompt.
If a user only wants to submit a single line prompt, pressing Enter twice might be extra effort, but I think it's worth it given that users can now use multiline prompts without "bugs".
We can also explore other options based on external libraries some time later but I think it's kind of useful to fix this so users can use CodeGemma etc.
Fixes #1275