-
Notifications
You must be signed in to change notification settings - Fork 10
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
Colours not working in Windows #6
Comments
This might be interesting (was looking through the colored crate issues), seems to include a possible fix for at least windows 10 with the control::set_virtual_terminal function. |
Hi, I'm going to fix it as soon as I can. |
I tested it and normal (without colour) mode works nicely but the problem persists with coloured text. Testing it with the set_virtual_terminal function, the colours as well as symbols are correctly displayed! I also want to mention as I failed to mention this in the bug report, this happens when a console is allocated(through AllocConsole) to my process (which doesnt have one), and the white colour could not be displayed for some reason (I tested with the white colour in a normal command prompt project and it worked fine). Nevertheless, set_virtual_terminal adds full functionality for all colours and symbols at both cases. |
I'm happy that it works now. I reckon I could include |
Yes that would be nice and I believe easily implemented with a conditional statement using the |
Right, should be added to the branch now. Could you just verify for the last time that it works without explicitly setting the virtual terminal like before? |
After that, it should be ready for a merge. |
Everything seems to work but I am not sure if the branch will compile in other OSes as you use a conditional compiled function in a function which is compiled on all OSes ( I have added a comment on the code with a potential fix) |
Right, That seems to be an issue. Where did you add your comment? I can't see it anywhere. |
If you go to the pull request, it is there. I was just saying to immediately set |
Setting it directly in the cfg! conditional doesn't actually seem to do anything since the set_virtual_terminal function is target_os limited by default so our build environment (ubuntu) won't be able to find it. |
To me, it looks like unfortunately the user will have to set it themselves. I could, however include a note in the readme so users won't get confused. |
Yes that should work and be quite straight forward. |
Describe the bug
In a Windows command line terminal, colours are not correctly displayed, instead random letters and symbols are (which I assume is the supposed syntax for the colour). This seems to be a problem with the colored crate but I would suggest to at least when using the None option for the colours to add no such syntax at all and just the spinner with the text (looking on how its done in the source code).
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A colour should be displayed (again, probably an error with the colored crate)
Desktop:
Additional info
This might not be able to be fixed by you (see above with the colored crate) but I like your crate so the suggested fix would be nice, so I can use the spinners without the colours :)
The text was updated successfully, but these errors were encountered: