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

cli: make output legible on black-on-white terminals too #158

Merged
merged 1 commit into from Sep 23, 2019

Conversation

electroniceel
Copy link
Member

@electroniceel electroniceel commented Sep 22, 2019

If you happen to use a black-on-white terminal, the regular output (info level) is white on white -> invisible.

I tried that this afternoon while showing Glasgow on a foreign machine and was wondering why there are just empty lines on the screen and first thought the Glasgow software stack I just installed was somehow broken. While testing a few things I provoked an error and then I saw what was going on. But a new user might be lost at first.

So do not enforce white, just keep the colors as they are by default. This should produce legible
output on white-on-black and black-on-white.

The only remaining problem is the warning level: it uses yellow which is very hard to read on a white background. Maybe change the warning color to red, bold red for errors, no color differentiation for critical (bold red too as they are now)?

If you happen to use a black-on-white terminal, the regular output
was white on white -> invisible. So do not enforce white, just
keep the colors as they are by default. This should produce legible
output on white-on-black and black-on-white.
@whitequark
Copy link
Member

Hm, I really don't like this new color scheme--I chose the current one for a reason. But I acknowledge that this is a problem.

Is there a way to detect black-on-white somehow?

@electroniceel
Copy link
Member Author

I think one can assume that the default color of the terminal works well for the user. That is why I kept it for the info level and just added the strong/bold format to it as it was before. Doesn't that work for your setup?

But I do not have preferences for this color scheme, I just think we should come up with something that works by default on most terminals, regardless of the color scheme used.

Is there a way to detect black-on-white somehow?

I'm not aware of a way to do that, although I do not claim to be an escape sequence expert. I think there were some hacks available in the past that allowed feedback from the terminal, but they were removed for security reasons as they could be misused to execute commands.

But even if there were a way to do this on a linux xterm, we should keep compatibility with more basic shells in mind. Like Windows or someone using Putty to ssh into his linux box where Glasgow is running.

@whitequark
Copy link
Member

I think one can assume that the default color of the terminal works well for the user. That is why I kept it for the info level and just added the strong/bold format to it as it was before. Doesn't that work for your setup?

I think it does, and I slightly misunderstood what you've done here.

I am strongly opposed to printing warnings in red.

@electroniceel
Copy link
Member Author

The yellow warnings aren't by far as problematic as the invisible info text. You can see that there is something, but you can't easily read it unless you for example mark the text with the mouse. I just thought if we are at it we might improve it too.

So what should we do with the warnings?

Keep them yellow and have a bit reduced user experience for black-on-white?

Or change them to another color? If not red, magenta, green and blue are still unused and legible on white bg. Although none of them has the connotation of a warning.

@whitequark
Copy link
Member

Blue isn't legible on black, other options don't really work.

@whitequark whitequark merged commit b6c88af into GlasgowEmbedded:master Sep 23, 2019
@electroniceel electroniceel deleted the cli-colors branch September 23, 2019 09:14
@whitequark
Copy link
Member

Reverted in 10661da.

@whitequark
Copy link
Member

I think we should just look at some environment variable to decide between black-on-white and white-on-black. Or something like that.

@emilazy
Copy link
Contributor

emilazy commented Sep 28, 2019

The default text colour and dark grey are readable on both light and black-backgrounded terminals, and should suffice for info/debug distinction.

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

Successfully merging this pull request may close these issues.

None yet

3 participants