-
Notifications
You must be signed in to change notification settings - Fork 57
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
Color codes garble output in PowerShell #6
Comments
This occurs because the Go Looking at https://docs.microsoft.com/en-us/windows/console/getconsolemode, I think what we're really interested in is whether the current console mode includes the Alternatively, we could just turn colouring off entirely on Windows, i.e. the check for colouring would not be Let me know your preference @corneliusweig - I have to admit I'm inclined to take the second option for now as it will be simpler and will still achieve the immediate goal of 'simple and well formatted.' |
Wow, thanks for your thorough investigation! You seem to be a PowerShell wizard :) I had thoughts into the same direction, to completely turn off colors on windows. Alas, that would also turn off colors on terminals that do support colors, like the widespread git-shell. However, your idea opens up a far superior alternative. I think we should definitely try this one out -- this tool is not production critical, so it's a good test balloon. Other projects could benefit from this solution too, if it works reliably! So let's try your idea about |
Usually, logrus does this when printing the first log message. Since we usually don't log anything before printing, this setup work needs to be done manually. The implementation is very much based on that from logrus. Fixes #6
Usually, logrus does this when printing the first log message. Since we usually don't log anything before printing, this setup work needs to be done manually. The implementation is very much based on that from logrus. Fixes #6
Expected behavior:
Output on PowerShell terminals is simply monochrome and well-formatted.
Actual behavior:
Unix terminal color codes are printed in PowerShell, thus making the output unreadable.
Relates to #5
The text was updated successfully, but these errors were encountered: