As mentioned before those programs are likely directly outputting ANSI escape sequences:
As 256-color lookup tables became common on graphic cards, escape sequences were added to select from a pre-defined set of 256 colors:
ESC[ … 38;5;<n> … m Select foreground color
ESC[ … 48;5;<n> … m Select background color
0- 7: standard colors (as in ESC [ 30–37 m)
8- 15: high intensity colors (as in ESC [ 90–97 m)
16-231: 6 × 6 × 6 cube (216 colors): 16 + 36 × r + 6 × g + b (0 ≤ r, g, b ≤ 5)
232-255: grayscale from black to white in 24 steps
This argument would also be strengethend by answers for a similar question titled Disable colours on terminal and SSH on the Unix SE.
In your previous questions for this topic you mentioned you're using xterm. The xterm man page also lists a
-cm option to disable recognition of ANSI escape sequences. This is also mentioned in the answers to the linked question:
This option disables recognition of ANSI color-change escape sequences. It sets the colorMode resource to "false".
What you're doing by setting the terminal information is that you define the capabilities of the terminal (as per man terminfo). As such, what you're doing equates to telling
ls and so on that you're sure you can do certain things but that doesn't mean they have to honor it in any way.