0xacx / chatGPT-shell-cli

Simple shell script to use OpenAI's ChatGPT and DALL-E from the terminal. No Python or JS required.
https://gptshell.cc
MIT License
1.05k stars 151 forks source link

Newline characters not being printed correctly #108

Open solarisfire opened 1 year ago

solarisfire commented 1 year ago

When chatgpt responds by giving advice on how to add a new line to some Python code, it doesn't return the correct character...

e.g.

image

Compared to it's response on the web chat where it does this correctly:

image

solarisfire commented 1 year ago

Oh, I guess I should have looked at the latest commit before posting this... 🤦🏻

solarisfire commented 1 year ago

Nope, updated to latest code from git and still getting the same issue:

image

mountaineerbr commented 1 year ago

You may try to install glow.

It seems you haven't got glow, so I reckon the problem is with echo -e in line 450.

OBS: I am not sure how to fix it because IDK how text in $formatted_text is stored (I would rather not install this script for testing myself as it messes up with sys configs).

solarisfire commented 1 year ago

Okay, that fixes it!

image

Maybe glow needs to be a dependency, or there should be some warning if glow isn't installed suggesting that it should be?

0xacx commented 1 year ago

Yes glow is an optional dependency and listed as optional in the prerequisites. Meaning this should work fine also without installing glow. I can't look into this right now so I will leave this issue open to examine.