Sample Header Ad - 728x90

How does `tput` detect color support

0 votes
1 answer
478 views
I am trying to make my shell script supporting as much terminals as possible, that is, adding ANSI colors, bold and dim only when supported. However, I want to detect the number of colors supported. We can use tput colors. However, I find that some systems that are stripped down to minimal does not have it installed. So, I want to implement it in shell. How does tput colors work? Any equivalent of tput colors with POSIX commands? Please help and answer.
Asked by sudoer (65 rep)
Jan 6, 2023, 12:44 PM
Last activity: Jan 6, 2023, 01:33 PM