question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:

image

Cmd in Windows Terminal:

image

cmd.exe:

image

Cmd in Cmder (based on ConEmu) - This works!:

image

Powershell in Cmder (based on ConEmu):

image

This last one can probably be considered working as well, the green text is likely due to the cmder config.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:5
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

6reactions
naveen521kkcommented, Oct 4, 2020

I found the problem here. Poetry uses cleo which in turn uses clikit which in turn uses pastel. Where pastel doesn’t support colours on Windows. The alternative is to use colorama, for colour.

2reactions
TBBlecommented, Jul 13, 2022

poetry --version with the latest Poetry master still does not use ANSI under Windows Terminal, but does with --ansi or when the ANSICON 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.

image

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found