asomers / gstat-rs

An enhanced version of FreeBSD's gstat(8) utility
BSD 2-Clause "Simplified" License
14 stars 0 forks source link

Document the NO_COLOR environment variable. #31

Closed asomers closed 8 months ago

asomers commented 8 months ago

This is handled by the crossterm dependency. When set, everything will be rendered in black-and-white, without any color.

asomers commented 8 months ago

@stesser this should help you on OSX Terminal. Note that you don't have to build from source to use this option. It's already handled; this PR just adds documentation.

stesser commented 8 months ago

Yes, in fact, NO_COLOR results in a pure b/w display. I'd think that the table heading could still be displayed with reversed colors (i.e. white on black) in that case, to make it better stand out. But I see that NO_COLOR is provided by anstyle and crossterm and it may not be possible to disable colors and still be able to emit the ANSI sequences to switch colors. But OTOH, it might still be possible to emit the Reverse display attribute "ESC[7m;" for the table heading when NO_COLOR is true.

asomers commented 8 months ago

Since NO_COLOR is handled by crossterm, I'm going to merge this as-is. I think it's good enough to be useful.