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

Default for the $COLUMNS #111

Open bas081 opened 1 year ago

bas081 commented 1 year ago

Some shells don't have the COLUMNS defined in certain cases.

This makes fold error: fold: invalid number of columns: ‘’

A sane default would be appreciated. Either really big or a standard width 80.

Simply changing $COLUMNS -> ${COLUMNS:-80} would be an improvement.

BalurPoco commented 1 year ago

I have the same error when run 'chatgpt -p "Text"' or 'echo "Text" | chatgpt'.

bas081 commented 1 year ago

I like the idea of this project but it does not cover my use-cases that well. I wrote something much simpler in bash that works for me. Maybe it helps this project or others: https://gist.github.com/bas080/2268473a12af12320d366b9dce7a0f6a

gtoravan commented 4 months ago

@BalurPoco Solved it by using at the start export COLUMNS=80

dnsang commented 2 weeks ago

I just encountered the same issue. so I quickly updated it and sent the PR here: https://github.com/0xacx/chatGPT-shell-cli/pull/162 please help review if it resolves the problem.