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

Default for the $COLUMNS

Open bas081 opened this issue 2 years ago • 4 comments

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.

bas081 avatar May 27 '23 14:05 bas081

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

BalurPoco avatar May 27 '23 20:05 BalurPoco

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

bas081 avatar May 27 '23 20:05 bas081

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

gtoravan avatar Mar 05 '24 23:03 gtoravan

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.

dnsang avatar Jun 18 '24 16:06 dnsang