candycat
candycat

Reputation: 505

How to determine if the terminal is a windows terminal

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:

What is the best practice?

Upvotes: 4

Views: 1058

Answers (1)

Markus Gans
Markus Gans

Reputation: 96

You can check if the environment variables WT_PROFILE_ID or WT_SESSION are present.

Upvotes: 5

Related Questions