No colors in Windows Terminal or cmd
See original GitHub issue- I am on the latest Poetry version.
- I have searched the issues of this repo and believe that this is not a duplicate.
- If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).
- OS version and name: Windows 10.0.18362.592
- Poetry version: 1.0.3
- Link of a Gist with the contents of your pyproject.toml file: n/a
Issue
This is https://github.com/python-poetry/poetry/issues/548 which was said to be fixed in “the latest beta” at the time, but now appears to be broken with no beta being more recent than the latest released version (1.0.3).
Long story short, there are no colors displayed on windows with any of the command shells I tried except in ConEmu. The default cmd.exe, powershell.exe and the new Windows Terminal don’t display colors.
Some screenshots:
Powershell in Windows Terminal:
Cmd in Windows Terminal:
cmd.exe:
Cmd in Cmder (based on ConEmu) - This works!:
Powershell in Cmder (based on ConEmu):
This last one can probably be considered working as well, the green text is likely due to the cmder config.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:14 (4 by maintainers)
Top Results From Across the Web
Windows Terminal Color Schemes | Microsoft Learn
Learn how to create color schemes for Windows Terminal. ... (for example, Windows PowerShell and Command Prompt) and some other options.
Read more >Use ANSI colors in the terminal - Windows CMD - SS64.com
To use ANSI colours in the Windows terminal requires setting VirtualTerminalLevel. VirtualTerminalLevel = 1 is now set by default for the terminal and...
Read more >Python text color is not working in CMD but it ... - Stack Overflow
I'm just working on a fun project to produce color in the console. In the Windows Terminal, it is working fine. However, in...
Read more >disable colors in Windows command prompt - Super User
The best way to do this is to chain the two commands you are using. ... That way, once the command is run...
Read more >PowerShell Themes and Windows Terminal Color Schemes
Windows Terminal is not available on earlier versions of Windows. ... the options available are Windows PowerShell and the CMD prompt.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I found the problem here. Poetry uses
cleo
which in turn usesclikit
which in turn usespastel
. Wherepastel
doesn’t support colours on Windows. The alternative is to usecolorama
, for colour.poetry --version
with the latest Poetry master still does not use ANSI under Windows Terminal, but does with--ansi
or when theANSICON
environment has been set.Although cleo no longer uses clikit, I recall looking into it last year, and the relevant code was just copied from clikit into cleo, and the relevant bug is now https://github.com/python-poetry/cleo/issues/104.