Comments (8)
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.
from rich.
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.
from rich.
Looks like colorama doesn't support 24-bit colour on Windows. The terminal itself does.
from rich.
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.
from rich.
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.
from rich.
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).
from rich.
Windows PowerShell 7.0.1 look like this screen
from rich.
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.
from rich.
Related Issues (20)
- [BUG] significantly changes the text to be printed. [v13.7.0] HOT 4
- [BUG] Live rendering issue with a specific Unicode character HOT 1
- [BUG] Panel borders broken if using a styled console as renderable HOT 5
- [BUG] multibyte characters in Progressbar TextColumn mess up render HOT 11
- [BUG] Documentation and code disagree about the type of `log_time_format` HOT 1
- [REQUEST] Backspace and Carriage Return support HOT 1
- [BUG] rich/13.7.0: tests failure on debian unstable HOT 1
- [BUG] Text inside Live with vertical_overflow="visible" duplicating when above console.height instead of scrolling HOT 2
- [BUG] Addressing Dashboard Freeze and Cursor Flicker Issues in Real-Time Data Applications Using Rich HOT 11
- Using Traceback Handler has no effect HOT 1
- [BUG] Inconsistent traceback logging HOT 4
- [REQUEST] Shortening error messages of certain modules similarly to frame suppression in tracebacks HOT 2
- [BUG] Restarting progressbar tasks does not restart their running clocks HOT 2
- [BUG] Captured console output still results in newline being printed in Jupyter HOT 1
- [BUG] Some colors aren't printed in bold HOT 4
- [BUG] Rich tracebacks raise another exception when suppressing sys HOT 1
- [BUG] Markdown blockquotes cause crash on Windows HOT 1
- Is there a way to print the line number while console.log'ging a single line? HOT 3
- [BUG] table.add_section does not draw a line / appear to do anything HOT 1
- Support for stdlib logging StreamHandler with `Live(redirect_stderr=True)` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rich.