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

PowerShell TrueColor is not correctly identified. #253

Open
callenAUS opened this issue Nov 4, 2024 · 1 comment
Open

PowerShell TrueColor is not correctly identified. #253

callenAUS opened this issue Nov 4, 2024 · 1 comment

Comments

@callenAUS
Copy link

Due to a strange decision in PowerShell, the true color compatibility is not shown in the TERM or COLORTERM env variable. microsoft/terminal#11057

my current work around is to just set these env variables before running the program but it would be nice to implement a check for a PowerShell terminal.

@a-usr
Copy link

a-usr commented Nov 13, 2024

FYI this has nothing to do with Powershell, it is the responsibility of the Terminal Emulator (Judging from the issue you linked in this case Windows Terminal) to set either of those Variables.

Now, the workaround for this would be to check the contents of the WT_SESSION env var, which Windows Terminal does set, assuming that Powershell, or any other Terminal Application you use, is launched from Inside Windows Terminal, since elsehow, as explained in the issue you linked, Windows Terminal wont get any chance to inject this (or any other) Environment Variable into the Process' Environment Block.

Lastly, if you dont use the newer Windows Terminal, but instead the Legacy Conhost, youre out of luck, as Conhost's support for ANSI Escape codes has to be turned on using a Windows API Call to the SetConsoleMode Function, which unless Im wrong isnt possible from js. In this case I recommend you upgrade to Windows Terminal, which provides a way better experience through features like multiplexing, tabs and SIXEL Image support (currently only in preview though), and has support for ansi escape sequences enabled by default.

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