Comments (2)
Apparently this is the reason why it doesn't work for cmd and powershell: https://superuser.com/a/1300251/97034
the new support for ANSI Terminal Control which was added to the Windows 10 console host in build 16257 (and later). Namely, it's n̲o̲t̲ e̲n̲a̲b̲l̲e̲d̲ by default. Unless the specific software you're using enables ANSI processing by calling the SetConsoleMode API with the ENABLE_VIRTUAL_TERMINAL_PROCESSING (0x0400) flag, you won't see colors or get ANSI processing for that application.
It's confirmed again at https://stackoverflow.com/a/35864976/675577
I'll try to fix it with some kind of if windows then set variable
. Apparently I used to have that behaviour e467333, through this method
P.S: Thanks for raising the ticket with all those details! 👌
from jcolor.
Looks like you as the user can enable that flag once and forever: https://stackoverflow.com/a/51681675/675577
Can you try these instructions on your machine, and tell me if it fixes the issue? Don't run both, choose powershell or cmd, and run the fix only for that one. We want to have one of the programs behaving incorrectly so we can test my fix later.
- (a) Activate support globally by default, persistently, via the registry, as detailed in this SU answer.
- In short: In registry key
[HKEY_CURRENT_USER\Console]
, create or set theVirtualTerminalLevel
DWORD value to1
- From PowerShell, you can do this programmatically as follows:
Set-ItemProperty HKCU:\Console VirtualTerminalLevel -Type DWORD 1
- From
cmd.exe
(also works from PowerShell):
reg add HKCU\Console /v VirtualTerminalLevel /t REG_DWORD /d 1
- From PowerShell, you can do this programmatically as follows:
- Open a new console window for changes to take effect.
- In short: In registry key
from jcolor.
Related Issues (20)
- Refactor: foreground and background words
- Which escape code to use?
- Test: convert acceptance test to snapshot test HOT 2
- Feature: allow dev to display color without printers HOT 1
- Fix "ghost formatting" on background
- Address all warnings in the code HOT 1
- Debugging Output in Eclipse IDE Does not format the markup HOT 1
- Probably Trailing new lines not supported/Line Break Issue HOT 4
- BACK_COLOR for True colors doesn't seem to work when I try with 5.0.0 HOT 7
- First word not printed properly HOT 2
- Feature: Support of clear screen HOT 4
- Import in java program HOT 2
- Windows Command Line and Powershell display ANSI escape codes instead of expected formatting HOT 8
- README.md code samples are confusing HOT 1
- Simple formatter like Color.format("text") with BB Codes or Markdown Syntax? HOT 3
- feature request: remove the jna dependency HOT 1
- bug report: CLEAR_SCREEN is not portable HOT 4
- Doesn't work on command prompt HOT 3
- Since v5.3.1 compile time dependencies include all maven-bundle-plugin dependencies HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jcolor.