-
-
Notifications
You must be signed in to change notification settings - Fork 254
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
On Python 3.5: Colorama does not recognize Windows environment #79
Comments
I narrowed it down. Somehow, Cygwin creates a TERM environment variable in my PowerShell console. Why does colorama test for this variable? |
The TERM problem was fixed in #48. Can you please check out the latest code from this repository and test if your problem is resolved? |
Thanks for your reply. I'll check my installed versions of Python colorama and so on. - it's not set as an env. var per user or system
Regards |
For what it's worth, I am having a similar issue using It used to be I could add the |
The logic in colorama 0.3.5 is to check whether the Windows console API calls are available for the running terminal, use them if they are available, and send the escape sequences otherwise. From what I know, the API is available only on Windows 'cmd' and PowerShell. I'm not sure how PyCharm runs the code and whether the Windows console API works on it. Maybe the API calls succeed but don't have any effect? I'll get PyCharm and try it out when I find the time.
|
Sorry I forgot to update this issue report, too. I found out that PoSh-Git sets the TERM variable. As a workaround I added this line after my Load-Module line in the profile.ps1:
After a PoSh-Git update the variable was removed. So the workaround could be removed. Regards |
I just tried out the following code in PyCharm 5.0.2 and it worked, thanks! I did not need the import colorama
colorama.init(strip=False)
print('{}Red'.format(colorama.Fore.RED)) |
I'd love to have this working but have trouble with the install: As an alternative, I've downloaded and unzipped the colorama file folder but don't know how to complete the installation. |
Hi @nickums . |
thankyou very much for your prompt and highly informative and helpful reply! On 27 February 2016 at 17:21, wiggin15 notifications@github.com wrote:
Nick "Mac" McElwaine |
no luck with colorama 0.3.6 or now 0.3.7. None of the earlier suggestions of varying init parameters make any difference, my text always appears unmodified in the default color. I note that IDLE colours my pgm text OK. Apologies if I'm doing something stupid here, I'm very new to the wonderful world of Python. RED, BLD, END = '\033[91m', '\033[91m', '\033[0m' |
As @johnthagen said, it works fine in both PyCharm and Windows CMD. |
Since my update of Python 3.4 to 3.5 colorama does not recognize a Windows environment if launched from PowerShell. Running colored scripts from cmd.exe does still work.
An explicit
init(convert=true)
call is needed.The text was updated successfully, but these errors were encountered: