How to know if running in ConEmu?

103 views Asked by At

I have a Java program, which emits ANSI escape sequences to generate colored output in a terminal. This works on Linux out of the box and it works on Windows, if the program gets executed in ConEmu. Now I would like to find out, if the environment is capable to display ANSI colors. On Linux I can check the TERM variable with System.getenv("TERM"). But on Windows how to find out in Java, if the program runs in a ConEmu terminal?

1

There are 1 answers

0
ceving On BEST ANSWER

Checking System.getenv("ANSICON") seems to be fine.