mattvr / ShellGPT

Upgrade your terminal with GPT-4. Ask questions, automate commands, pipe I/O, etc. Made with Deno.
MIT License
228 stars 11 forks source link

Can't have line breaks in pasted input #7

Closed pseudosavant closed 1 year ago

pseudosavant commented 1 year ago

First, I love ShellGPT. I use it a ton. Thank you!

Second, I wish there were a way in the REPL to paste in content, or type in content, which has line breaks. Is there a way to have line breaks in input in the REPL? Perhaps a different key combo (Ctrl+Enter?) could be used to submit a request?

I think it would require replacing prompt with stdin/stdout handling. I've never done much with CLI apps in Deno but if I'm feeling adventurous and have the time I might give it a try myself.

mattvr commented 1 year ago

Thanks @pseudosavant! I just published an update supporting newlines in the repl.

It works by ignoring if a newline is quickly followed by another character.

So if you paste something in, it will no longer trigger sending messages. The only case it would send is if your pasted content ends with a newline, so try to avoid that.

Let me know if this works and if you have any issues.