-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Colors doesn't work on Git Bash #330
Comments
You are missing some environment variables that set the locale. Try the following:
Or
|
What is your TERM env var set to?
Does this give you None? from rich.console import Console
console = Console()
print(repr(console.color_system)) |
$ echo $TERM
xterm
$ echo $COLORTERM
The below one gives me None. from rich.console import Console
console = Console()
print(repr(console.color_system)) |
How about this?
and this...
|
$ echo $NO_COLOR
The second one is False. |
If "is_terminal" is False it means that git bash isn't a real terminal, and Rich is defaulting to text without color. You can force Rich to bypass terminal detection with the following:
I don't know much about git bash, but it looks like it is emulated and not a full terminal. |
Update: Trying the same on Msys2 MINGW32 bash shell I got the coloured output but it looks worse with tables.
print(console.is_terminal) ^ returned True. |
It looks like it doesn't support unicode characters as used by the table borders. You should use |
Describe the bug
I am Windows 7 and install python 3.8 where I used Git Bash(For a change.). I typed the following things in terminal where it should show the image as in ReadMe.
While I get a long error Message of UnicodeEncodeError
The output I get is
and no colours in it.

Also, when I run
py -m rich.logging
I get a ZeroDivisionError.
Btw, everything is fine with CMD or Powershell.
To Reproduce
Running
py -m rich
in Git Bash For Windows shows these errors.Platform
I am on Windows 7. The terminal I am using is Git bash. The rich version is
rich==8.0.0
The text was updated successfully, but these errors were encountered: