- Standardize capability usage with the terminfo database for
portability. POSIX tput does declare only the basic options such as
'init', 'reset' and 'clear', leaving the rest unspecified, that is not
ideal but hard coding escape sequences is way worse.
- Set colorization options based on number of colors the terminal
supports and not the TERM variable when possible. This is incomplete,
terminal emulators may support or adapt more than it is advertised,
but involves using DECRQSS queries and delays, as an example, 'resize'
utility from XTerm uses 3 seconds as delay, this is worrisome.
- Term with only '-direct' variants without ending with 256 means it
only supports direct-color indexing, therefore 'tmux-direct' cannot be
used, but the non-multiplexer terminal 'xterm-direct256' can.
Echo can interpret operand as an option and checking every variable to
be echoed is troublesome while with printf, if the format specifier is
present before the operand, printing as string can be enforced.