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.

[BUG] Coloring does not work in PyCharm

See original GitHub issue

Just checked - it seems to be a PyCharm problem, I will report it there, so this report is just FYI for rich users who use PyCharm. It works in the PyCharm terminal (command line), but not inside the stdout pane of PyCharm.

Reproduction Replace print() statement with console.print(string, style=‘bold red’). The string is printed, but no coloring.

from rich.console import Console
console = Console()
console.print('==> Mismatches were found in one or more platforms <==', style='bold red')

Windows 10, PyCharm Community (lastest), Python 3.8, Rich 5.0.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:17

github_iconTop GitHub Comments

10reactions
willmcgugancommented, Jan 16, 2021

Not without breaking things for other users.

8reactions
willmcgugancommented, Aug 4, 2020

Interesting. That suggest the stdout window is not an embedded console. Rich will disable color if it detects it is not connected to a real terminal.

You could try this:

console = Console(color_system="windows")

That will force Rich to write color, but if PyCharm can’t handle it, you may end up with garbage.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[BUG] Coloring does not work in PyCharm · Issue #206 - GitHub
It works in the PyCharm terminal (command line), but not inside the stdout pane of PyCharm. Replace print() statement with console.
Read more >
Color scheme bug - IDEs Support (IntelliJ Platform) | JetBrains
Hello,. I would like to report a weird coloring behavior that I had for a while. I tried to reset to default theme...
Read more >
PyCharm UI does not display colors according to set values ...
However, when I open the a color picker to test the values on the swatch as well as the background color of the...
Read more >
Todo highlighting not working [PyCharm 2018.3.4 (Pro) #PY ...
Now i came back, updated the IDE and the highlighting of todo-items does not work properly anymore(neither builtin nor custom ones). The ...
Read more >
Colorama coloring doen't show up in console : PY-16927
When run python script using External tool on PyCharm, 'PYCHARM_HOSTED' environment value is not set. So we have to manually set the env...
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