dirr
dirr copied to clipboard
Improve color handling and DIRR_COLORS
- Default fifo type character color was invisible since 2d93da9078, because its color is high-intensity black (8) and Gputch only checked that foreground != background. a) Check bold and blink attributes as well as color.
-
DIRR_COLORS
variable created duplicates intype()
,info()
, etc., causing inconsistent results. a) Replace color settings specified inDIRR_COLORS
instead of just adding. - Setting anything in
DIRR_COLORS
removed default byext coloring, even with no new byext specified. a) Only delete byext when a byext pattern is included inDIRR_COLORS
(byext()
for none). - Also modified
GetName
to ignore nonprinted (colored 0) type characters in spacing calculations.
- Deleted 8b34cef (item 4); I hadn't considered different terminal fg/bg colors.
- Removed blink exemption from Gputch invisible characters check; blinking with same bg/fg is also invisible.
Some terminals may treat blink as a high-intensity option for the background color. The blink exemption is valid.
Alright, it's back in.
I've made a couple of improvements to the byext
handling; does this PR look good to go?
There's also another color-related bug I'm not sure how to resolve - background colors can sometimes bleed backwards through spaces. Here's what I've figured out so far:
- 5+ spaces: AnsiOpt takes effect, moves cursor with escape code (does not fill with bg color)
- Issue: unable to have colored blank space
- this is the TODO at cons.cc:356
- workaround of non-space chars with same fg/bg doesn't work, it gets optimized out
- <5 spaces or -P: No AnsiOpt, prints spaces instead (fills with bg color)
- Issue: background color bleeds backwards through spaces as shown below with file
test?
- Issue: background color bleeds backwards through spaces as shown below with file