ShellGPT icon indicating copy to clipboard operation
ShellGPT copied to clipboard

Request: be able to paste long pieces of text in repl mode

Open nicobrenner opened this issue 11 months ago • 3 comments

I wanted to paste 394 lines of text, mostly code and then a prompt at the end (like the snippet below)

But when I tried pasting the text, gpt cut it off pretty early, then got stuck in a loop of getting pieces of the text and then giving a really long answer, then it even stopped responding to CTRL+C (^C), so I had to kill the process, but then the text kept pasting and executing in bash, so I had to kill the terminal 😅🤣 (You can see the whole thing at 20:17 here: https://www.loom.com/share/cab4f33752b44e5f8b77d30a0299d69e?t=1217)

Anyway, it would be cool to be able to paste large prompts 🙏🏼

I understand that maybe I could store the whole thing in a file and pipe it in without the repl option, but then I would lose the history/context, which is helpful in my coding interactions with chatgpt

# 300+ lines of code

The above is a python3 and ncurses application. And it needs tests. Write a test for the Add/Edit resume feature.
Provide python3 code, a description of the test, the path of the file where to save the test, instructions on how to run it.
No yapping please

nicobrenner avatar Mar 09 '24 22:03 nicobrenner

Was trying to run the code on my computer, I cloned the repo, pulled from main, created a branch

I couldn't find anything in the README about how to run/build the application

Looked up the deno documentation and tried deno run mod.ts, but then the Enter key doesn't work, it just types out ^M, but it's not captured

Then saw the command inside the gpt executable script and tried exec deno run --allow-all --no-config mod.ts "$@"

That worked, but it asked me to update, I said no and then in closed the whole terminal window, which I wasn't expecting

Anyway, it would be great to have some documentation on the README about how to run/build the application from source

Thank you! 🙏🏼

nicobrenner avatar Mar 10 '24 05:03 nicobrenner

Thanks for reporting this. There's some custom handling of newlines to allow code to be pasted in. As a short-term workaround you could try using non-repl mode and cat the file.

Not sure if I'll have time to fix soon, but as for how to develop, you should be able to just do deno run -A mod.ts --repl?

mattvr avatar Mar 11 '24 05:03 mattvr

Cool, thank you, deno run -A mod.ts worked! 😄

Created a PR adding a small Development section to the README (https://github.com/mattvr/ShellGPT/pull/22)

nicobrenner avatar Mar 11 '24 17:03 nicobrenner