Closed erikd234 closed 3 months ago
As it is mentioned in README.md, there is an option to provide multiline prompts using triple quotes """
:
sgpt --repl temp
Entering REPL mode, press Ctrl+C to exit.
>>> """
... Explain following code:
... import random
... print(random.randint(1, 10))
... """
It is a Python script that uses the random module to generate and print a random integer.
So in this case, you can enter REPL mode, type """ + enter
and then paste <ctrl+shift+v>
.
Pasting from clipboard into --repl mode does not handle new line characters
For example lets pretend we have the following in clipboard
"this is a bunch of text \n with many newline characters \n"
sgpt --repl chat
>> <ctrl+shift+v>
When we do the above and paste it only one line at a time is paste and sgpt will break up the input into as many prompts as new line characters for example
>> this is a bunch of text
response from sgpt
>> with many newline character
response 2
This makes it really hard for me to productivy use the --repl mode to modify code and text when I want to frequently copy and paste.
I have two work arounds that I dont like
Can we make the --repl interface accept pastes with newline characters???
if there is a way i am happy to contribute and give the enhancment a shot. Just let me know if you would accept a PR with this feature and if you think this feature is possible (i have not read the codebase in detail yet for how the --repl interface is handled)
thanks.