Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect 16m color support on Windows >=10.0.14931 #17

Open
o2sh opened this issue Nov 3, 2023 · 1 comment
Open

Detect 16m color support on Windows >=10.0.14931 #17

o2sh opened this issue Nov 3, 2023 · 1 comment

Comments

@o2sh
Copy link

o2sh commented Nov 3, 2023

Hello 👋 ,

We're currently thinking about using supports-color to verify if the terminal supports truecolor (has_16m) in onefetch. However, we've encountered an issue with Windows.

It appears that @sindresorhus's NPM package handles this situation correctly, cf. chalk/supports-color/pull/71.

Thanks in advance👍

@a-usr
Copy link

a-usr commented Mar 11, 2024

You can detect Windows Terminal, the default Terminal Emulator on Win11 (not Win10) by checking wether the WT_SESSION Environment vaiable is set. However this only works if your program is launched directly by Windows Terminal or a different program that was launched by Windows Terminal. Only that way Windows Terminal can Inject the WT_SESSION Environment Variable. See this comment on Windows Terminal:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants