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

Document whether Windows is supported #4

Closed
pfmoore opened this issue Jan 26, 2020 · 8 comments
Closed

Document whether Windows is supported #4

pfmoore opened this issue Jan 26, 2020 · 8 comments

Comments

@pfmoore
Copy link

pfmoore commented Jan 26, 2020

I can't tell from the documentation, or the PyPI classifiers, whether Windows is supported. I'd like it if it were, but obviously that's up to you as a developer. But could you document more clearly whether you do, so that I don't have to download the library and try it out to check?

@willmcgugan
Copy link
Collaborator

I don't have a Windows box here and I haven't got Windows CI set up yet. Until then I can't be certain it works in Windows.

It should. Try installing and running python -m rich.color if its not too much of an inconvenience for you.

@pfmoore
Copy link
Author

pfmoore commented Jan 27, 2020

Hmm, it seems to only show blocks of colour for what appear to be the basic 16 colours - things like "grey93" just show as black. And then it aborts with a traceback

Traceback (most recent call last):
  File "C:\Users\UK03306\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 192, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\UK03306\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Work\Scratch\rc\lib\site-packages\rich\color.py", line 480, in <module>
    console.save_html("color.html", inline_styles=True)
  File "C:\Work\Scratch\rc\lib\site-packages\rich\console.py", line 903, in save_html
    write_file.write(html)
  File "C:\Users\UK03306\AppData\Local\Programs\Python\Python38\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 238-313: character maps to <undefined>

So I guess there's some encoding issues to address. And it may be that the Windows terminal doesn't even support rich colours (I thought recent versions did at least, but I've no real idea how to check 🙁)

The main thing for me is that you're using colorama, so you have a reasonable expectation of things being cross-platform - but without access to a Windows system it's only ever going to be "try it and see, and PRs gratefully accepted". Which is totally reasonable. (Also rich.color is a nice way of doing a quick test).

I'm not sure I'll have time in the near future to offer any patches - I mostly looked at the library from curiosity (I saw a reference on Planet Python). But if I have a project at any point where I'd actually use the library, I'll see if I can help with Windows for you.

@pfmoore
Copy link
Author

pfmoore commented Jan 27, 2020

@willmcgugan
Copy link
Collaborator

Well that's promising at least. I suspect with the encoding issues fixed I can get it working in some fashion.

If colorama can't do 24-bit I can downgrade to 256 colors (already implemented), or I could attempt to support Windows codes natively.

I'm probably going to focus on fixes and features in the short term, but I will dig out a Windows laptop at some point.

@pfmoore
Copy link
Author

pfmoore commented Jan 27, 2020

Thanks for the feedback - no pressure, I may be the only one interested in this, and as I say I don't have a project for it right now, so don't feel obliged on my account :-) I appreciate your time responding here.

@willmcgugan
Copy link
Collaborator

v0.3.3 has fixes for Windows.

Seems solid enough, but it is restricted to what Colorama supports. No italic / bold and only 8 colors (16 if you include bold which is rendered as bright).

@Kirill
Copy link

Kirill commented Jun 5, 2020

Windows PowerShell 7.0.1 look like this screen
ss_20200605_132958_2

@willmcgugan
Copy link
Collaborator

Yeah, there's been some changes for the new Windows terminal, which is on par with OSX / Linux now. Old cmd works, with reduced colors.

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

3 participants