Hi! Instead of playing whack-a-mole with TERM strings, what about just assuming color support?
The last terminal I've seen to not support colors was Windows 98's telnet.exe, and even that ignored them silently instead of spewing crap. Thus, it'd be appropriate to assume that an unknown terminal supports at least 16 color mode. We're close to be able to assume 256 color, too: even terminals which don't support that tend to do a reasonable thing and approximate (linux, freebsd, screen). But dircolors doesn't yet use 256 color anywhere, so that's moot for now. So, please consider either: * just dropping TERM detection code, or * make it opt out rather than opt in, by looking for hypothetical TERM=dumb Your detection code also assumes that vt100 supports color which it does not. But hey, any sightings of that TERM string come from misconfigured getty (still the default?) rather than from actual museal hardware -- which does ignore unknown but well-formed SGR codes anyway. Meow! -- ⢀⣴⠾⠻⢶⣦⠀ ⣾⠁⢰⠒⠀⣿⡁ Imagine there are bandits in your house, your kid is bleeding out, ⢿⡄⠘⠷⠚⠋⠀ the house is on fire, and seven big-ass trumpets are playing in the ⠈⠳⣄⠀⠀⠀⠀ sky. Your cat demands food. The priority should be obvious...

