Skip to content
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

traceback formatting does not seem to work on windows powershell #59

Closed
vlschmidt opened this issue May 7, 2020 · 6 comments
Closed

Comments

@vlschmidt
Copy link

Using the newest install from pip and Powershell 5.1 or 7.1 i get the following output on my windows 10 pc:

Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 23:11:46) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from rich.traceback import install
>>> install()
<built-in function excepthook>
>>> k
�[1mTraceback�[0m �[2m(most recent call last):�[0m
�[34m╭──────────────────────────────────────────────────────────────────────────────────────────────────╮�[0m
�[34m│�[0m File �[32m"<stdin>"�[0m, line �[1;36m1�[0m, in �[33m<module>�[0m                                                              �[34m│�[0m
�[34m╰──────────────────────────────────────────────────────────────────────────────────────────────────╯�[0m
�[1;31mNameError: �[0mname �[32m'k'�[0m is not defined

running a command such as
rich.print("[blue]Hi[/blue]")
work as expected.

@vlschmidt
Copy link
Author

interestingly it works in the newest release of windows terminal:
https://github.com/microsoft/terminal/releases/

@bclehmann
Copy link

By default powershell and windows terminal use different fonts. (Powershell uses Lucida Console and Windows Terminal uses Consolas). Changing your powershell font to Consolas may help.

To change the font right-click the window's titlebar > Properties > Font

@vlschmidt
Copy link
Author

Thakns for the reply. Changing the font does not change the output for traceback which includes strange characters and lack of color. My workaround for now is using the windows terminal (which runs powershell)... not sure how I would debug this in any case.

@frankenstein91
Copy link

same problem in pycharm terminal

@willmcgugan
Copy link
Collaborator

I think it was an issue with colorama not being initialized. Please try v1.0.2

@vlschmidt
Copy link
Author

vlschmidt commented May 8, 2020

Yes works with v1.0.2 thanks! At least for powershell, i'm not sure about pycharm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants