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:
And this is what I get when I run
python -m rich
in the cmd:
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).
Answers:
The classic Windows terminal doesn’t support any of the text styles, and only 16 colours.
There is the new Windows Terminal by Microsoft in case anyone didn’t know.
Install the Windows Terminal from the Microsoft Store.
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:
And this is what I get when I run
python -m rich
in the cmd:
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).
The classic Windows terminal doesn’t support any of the text styles, and only 16 colours.
There is the new Windows Terminal by Microsoft in case anyone didn’t know.
Install the Windows Terminal from the Microsoft Store.