chatGPT-shell-cli icon indicating copy to clipboard operation
chatGPT-shell-cli copied to clipboard

Newline characters not being printed correctly

Open solarisfire opened this issue 2 years ago • 5 comments
trafficstars

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 avatar May 18 '23 11:05 solarisfire

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

solarisfire avatar May 18 '23 11:05 solarisfire

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

image

solarisfire avatar May 18 '23 11:05 solarisfire

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).

mountaineerbr avatar May 18 '23 14:05 mountaineerbr

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?

solarisfire avatar May 18 '23 15:05 solarisfire

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.

0xacx avatar May 18 '23 15:05 0xacx