rocky / shell-term-background

POSIX shell scripts to figure out if a terminal has a dark or light background
GNU General Public License v2.0
35 stars 4 forks source link

Better background detector #7

Closed egberts closed 4 years ago

egberts commented 4 years ago

I made a better background detector based on not only looking at the red element of the RGB, but the total sum of all 3-elements of an RGB, but only for the xterm portion.

Then (for xterm) I performed comparison between foreground RGB and background RGB to see who is "truly" the darker side.

Also, it has some more quirks to deal with gnome-terminal adding escape characters to the end of its ANSI OSC command response to the OSC foreground and OSC background commands.

rocky commented 4 years ago

Will change after merge.

egberts commented 4 years ago

Are you requesting new pull request with requested changes for multi-shell support, or declining to merge due to lack of test environments?

rocky commented 4 years ago

Sure new pull requests are great - bring it on.

This isn't CI tested anywhere yet. CI testing even at a limited scale would be awesome.