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
There are 2 different and complementary approaches here:
TERMenvironment variable being
xterm-coloror an option passed to the program to try to use colors or not.
You should simply state it clearly in your documentation. Something like:
This application requires an xterm compatible terminal. If the
TERMenvironment variable is
xterm-coloror if this parameter is passed of that system property is present it will use colors.
(substiture this and that with relevant options...)
This application is based on the
terminfosystem. Be sure to set the the
TERMenvironment variable to the best possible emulation. Colors are supported by application if present in