sectordistrict / intentrace

intentrace is strace with intent, it goes all the way for you instead of half the way. intentrace is currently in beta
MIT License
509 stars 8 forks source link

How do I turn off colours? #4

Open vi opened 1 week ago

vi commented 1 week ago
  1. How do I turn off the colours?
  2. How to make it assume white background, not dark background on terminal.

P. S. Multiple Rust tools that use coloured terminal output seem to assume black background by default and look poor in my setup. Maybe there is a cross-app way (e.g. a environment variable) to notify all the programs that the background is white?

sectordistrict commented 1 week ago

regarding point 1, for now I think a good setup would be to introduce a cli option that turns off the colors, I will have to see how I will work this out, I suggest this workaround for your case: pipe into sed like the following intentrace ls | sed 's/\x1B\[[0-9;]\{1,\}[A-Za-z]//g' it also works when the background is whitish

for point 2 and the rest, I agree there's a general assumption that everyone uses dark mode terminals, however I think any thing in the vicinity of "working around a light/dark mode" of sorts for a terminal application will require intentionality in design to remedy, I don't believe there's a generalizable way of working around a white background terminal, however I'm interested in making this work so I'll prioritize this (most likely this will also be a cli option)

thecaralice commented 1 week ago

Try running with NO_COLOR=1. Most likely the library used for coloring understands that. See https://no-color.org/.

vi commented 1 week ago

Yes, it does remove the colours.

Maybe there is another magical environment variable to map lighter colours to darker ones for light backgrounds?

thecaralice commented 6 days ago

Maybe there is another magical environment variable to map lighter colours to darker ones for light backgrounds?

I am not aware of any such consensus. There's NO_COLOR which explicitly disables usage of colors and CLICOLOR{,_FORCE} which control automatic detection of whether colors should be used. These three are semantically equivalent to --color={never,auto,always} some programs have.

You should consider changing your terminal color palette so that "bright" colors are actually darker, that would work for all programs using 3/4-bit colors.