-
-
Notifications
You must be signed in to change notification settings - Fork 255
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
Colorama not working with Git Bash (mintty): colors should not be stripped #224
Comments
Hi @Delgan! I tried to reproduce this issue, but it seems to be working fine here:
|
Hey @1138-4eb. :) Could this be because I'm using the full "MINGW" emulator, while you are using the minimalist "MSYS"? I'm not sure of why your |
I'd say that both of us are using the same MSYS/MINGW shell (no matter MSYS, MINGW64 or MINGW32). I installed it with http://repo.msys2.org/distrib/x86_64/msys2-x86_64-20190524.exe. However, environments are not exactly the same:
FTR, I tried the snippet on cmd and powershell. Both of them use Python from Therefore, I think that this might be an issue when Python is installed 'natively'. Did you try with cmd and/or powerhsell? |
You are correct, I installed Python using the binaries on python.org. I think you are right, it works fine for you because MINGW64 uses its own Python installation, while in my case it uses the one from Windows. |
I wonder where is that bash coming from. Is it an alias provided by powershell? Is it WSL? It can't be
You don't have If you switch from 'Git for Windows' to MSYS2, you can install
I think that the last cases to try are the command prompt and MSYS2 with a non-mingw Python installation. Did you try the former? Ref VUnit/vunit#539 |
@1138-4eb Oups, sorry, you wrote "bash" but my brain read "cmd". Of course, I could not and I did not test with So, I tried to run my Windows Python from MSYS2 and the result was the same, no colors: |
Refs: |
@1138-4eb Both solutions work! I think one may solve this by checking for the |
#226 worked for me too! |
What did you set the value of the environment variable "TERM" to be? |
@jyotsnarupaliya At the time I tried, colorama/colorama/ansitowin32.py Lines 45 to 47 in 7a85efb
The |
I stumbled accross this issue as well, is there a long term solution planned? |
Hi.
Did you noticed that
colorama
was not working on Git Bash for Windows?Steps to reproduce is quite straightfoward: on Windows, run
get-bash.exe
, start the Python interpreter withpython -i
, importcolorama
and then callinit()
, finally you will see thatprint("\033[31m" "some text" "\033[0m")
strip ansi codes but doesn't color text.This is related to mintty not supporting WinAPI calls. Ansi code are well supported in this terminal emulator and should not be replaced.
Do you think there is a way to automaically detect such environment?
The text was updated successfully, but these errors were encountered: