-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
Windows color logging #70
Conversation
Specifically with Windows CMD.
NOTE this is based on #69, which ideally would be merged before reviewing/merging this. I've successfully seen pywal16 working under Windows 10 with CPython 3.12.1. For example:
|
Will this work on terminals on Windows that support ANSI colors such as Wezterm and MSYS? |
There was also a refactoring of the Windows console so that the next Windows Terminal release will support sixel images, so this might not be needed. |
no idea, i've not used a microsoft windows OS since about 2012 so cannot comment on werether or not pywal works there, i just merge whatever windows users PR, hopefully it'll work on windows, else they will open more PRs. |
@clach04, does this just get the output log to work right after running wal on the stock windows console? It already works in Windows Terminal. |
I'm a mintty (as used by msys/msys2) user myself, yes it works. I can't comment on Wezterm (I've tried a few new Windows terminals and none work well for me for day-to-day use). Only negative thing I can say about mintty is that out of the box it doesn't support color emoji (which the Microsoft Termain does handle well). There is no point in adding a check to be called, that's the responsibility of Colorama. If we find a problem case we should either fix Colorama or report a bug upstream. Here are a few screenshots showing the working logging with colors: Windows CMDmintty with Windows CMDmintty with bashIn all cases, ignore the preview, they are showing the current colors NOT the new pywal generated one. |
Correct. As per PR title. |
There are ways around this, at least for CMD and mintty. I'd not thought of using powershell with Windows Terminal to set the new colors, neat idea 👍 ! For CMD there is a Microsoft color tool that could be used with pywal output - Windows Console Colortool https://github.com/microsoft/terminal/releases/tag/1708.14008 For mintty there is a way to refresh the active color scheme - BUT I've not had chance to play with that yet. Your cat technique may be the most straight forward option :-) I've not yet looked into logic in pywal for trigging scripts before the color preview is shown. |
Interesting, so that is why winwal uses colortool. It is for cmd, apparently.
Colorama doesn't appear actively maintained.
There are a few open issues for colorama for mintty. I don't know what these issues are about though. Also, the next release of console and Windows Terminal support sixels, so command prompt / windows console may support ANSI colors (I'm not sure though). |
Looks like there is 1 open issue and one open PR (for that issue) https://github.com/tartley/colorama/issues?q=mintty+is%3Aopen If we encounter issues with pywal and Colorama, I'm willing to fork/fix those. @ykhan21 Have you had any issues with this code change on your machine. Thanks for the winwal link, I'd not seen that before. Annoyingly I already created a ColorTool template and if I'd seen this I could have save myself a few minutes. |
I haven't had a chance to test it yet. winwal calls pywal and does some additional things. Two useful things winwal does that pywal doesn't do is set the colors for the Windows Terminal gui and use colortool so cmd can have color. Everything else can be done with pywal. It might make more sense for the workflow to be reversed, where pywal is called, then the powershell functions you need are called in a script passed to pywal with There is some discussion of pywal on windows here if you're interested. |
No description provided.