Reputation: 505
How to determine if the terminal is a windows terminal.
I want to enabled ANSI output in windows terminal and disenabled in CMD.
Is it possible to judge through environmental variables? like:
ANSICON
in https://github.com/adoxa/ansiconConEmuANSI
in https://conemu.github.io/en/ConEmuEnvironment.htmlWhat is the best practice?
Upvotes: 4
Views: 1058
Reputation: 96
You can check if the environment variables WT_PROFILE_ID
or WT_SESSION
are present.
Upvotes: 5