C-Otto / rebalance-lnd

A script that can be used to balance lightning channels of a lnd node
MIT License
343 stars 82 forks source link

Feature Request: Add a flag to turn off formatting #307

Closed 9rib-on-the-grind closed 1 year ago

9rib-on-the-grind commented 1 year ago

Due to my terminal color scheme, it is impossible to see some output. Please, consider adding a flag to turn off all the formatting (background, font color, bold formatting, etc). It would be easier to read the data if the color scheme is incompatible or absent (if redirecting output to the less tool for example).

Screenshot_401 Screenshot_401

C-Otto commented 1 year ago

Try starting rebalance-lnd with FORCE_COLOR=false or TERM=dumb:

FORCE_COLOR=false ./rebalance.py -l

This should get rid of all color markers. For me, piping the output to less works as expected even without this trick. The underlying library yachalk should be able to detect color support. In the case of less the support should be disabled. Could you please file an issue at https://github.com/bluenote10/yachalk?

Here's the code that determines whether colors are used:

https://github.com/bluenote10/yachalk/blob/master/yachalk/supports_color.py

9rib-on-the-grind commented 1 year ago

I tried FORCE_COLOR and TERM, and both work. Thank you for the hint!

Also, it works as expected when running the ./rebalance.py with or without these variables and then piping the output to less. Previous runs were made with docker, I suppose the library detected color support inside the docker container, and later this formatted output was piped to less. I fixed it by adding -e FORCE_COLOR=false to the docker run command.