TheR1D / shell_gpt

A command-line productivity tool powered by AI large language models like GPT-4, will help you accomplish your tasks faster and more efficiently.
MIT License
9.83k stars 771 forks source link

indentation issue in code snippet #436

Closed azinsharaf closed 10 months ago

azinsharaf commented 10 months ago

Thanks for this great app. when shell gpt returns a code snippet it adds blank space at the beginning of each line (see the screenshot below, highlighted in red) so if I copy it into any ide it creates indentation error. In ChatGPT copying the snippet doesn't have the issue. Am I missing something?

image

TheR1D commented 10 months ago

Unfortunately, the way text is rendered in a terminal/shell differs from how it's displayed in a browser. To format markdown, the shell uses space characters for indentations and formatting. When copying code snippets into an IDE, I recommend using the --code option to generate pure code without additional formatting.