Why can't Python rich print text styles, only colors, on Windows command line?

Question:

The problem is that I can’t print any text style.

This is my code, and I don’t think it’s faulty:

from rich.console import Console

console = Console(highlight=False)

console.print("Test print")
console.print("[green]Test print (green)")
console.print("[bold]Test print (bold)")
console.print("[bold underline]Test print (bold underline)")

input()

This is what I get after running the script:

screenshot of terminal output

And this is what I get when I run

python -m rich

in the cmd:

screenshot of terminal output of "python -m rich"

What should I do? I tried it on Windows Terminal (from MS Store), and I got much more color and all the text styles, but I can’t set Windows Terminal as default (I have Windows 10, not Windows 11).

Asked By: Oxunum

||

Answers:

The classic Windows terminal doesn’t support any of the text styles, and only 16 colours.

Answered By: Will McGugan

There is the new Windows Terminal by Microsoft in case anyone didn’t know.

Install the Windows Terminal from the Microsoft Store.

Answered By: miica
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.