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

Colorized output on windows 7 broken #862

Closed
ceriath opened this issue Nov 15, 2018 · 4 comments
Closed

Colorized output on windows 7 broken #862

ceriath opened this issue Nov 15, 2018 · 4 comments

Comments

@ceriath
Copy link
Contributor

ceriath commented Nov 15, 2018

When printing output with a TextFormatter to cmd or powershell on windows 7, the control sequences are rendered to the output.

←[36mINFO←[0m[0000] Replay took: 4.0003ms ←[36msource←[0m=Badger

This was already mentioned in #820 but probably never investigated.

Workaround: Just disable colors with

log.SetFormatter(&logrus.TextFormatter{
		DisableColors: true,
})
@dgsb
Copy link
Collaborator

dgsb commented Nov 16, 2018

I do not have any windows test environment, any help on this issue would be greatly appreciated

@ceriath
Copy link
Contributor Author

ceriath commented Nov 16, 2018

So i've been investigating a bit and it seems like windows 7 does not support colors on commandlines at all, while windows 10 made it an option (which is off by default) with some update. The easiest solution is probably to just disable it entirely on windows

@dgsb
Copy link
Collaborator

dgsb commented Nov 22, 2018

@ceriath is there a way to detect if coloring is activated or not ?

@ceriath
Copy link
Contributor Author

ceriath commented Dec 9, 2018

@dgsb sorry for the late response, totally forgot about it. It seems like you could try and search for a registry key on newer windows, but apparently it's not always there either. so not really a reliable way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants