I'd like to detect whether the system console supports ANSI color codes (and which ones) from a Java application without relying on native code (meaning, I cannot interact with ncurses).
Is there an easy and reliable way to map $TERM
to the list of color codes that the console supports?
Does my application really need to support the hundreds of terminfo codes found at http://invisible-island.net/ncurses/terminfo.src.html or is there a minimal list that I should be checking for instead (e.g. xterm
, xterm-color
and xterm-256color
)?
UPDATE: I found an excellent overview of terminfo at http://tldp.org/HOWTO/Text-Terminal-HOWTO-16.html