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

Yellow and Magenta do not display in powershell #2

Closed
danielchatfield opened this issue Aug 14, 2013 · 3 comments
Closed

Yellow and Magenta do not display in powershell #2

danielchatfield opened this issue Aug 14, 2013 · 3 comments

Comments

@danielchatfield
Copy link

I'm not sure what should be done about this, if anything.

Yellow isn't too much of a problem since it displays as white but magenta actually displays as the same colour as the powershell background which isn't exactly ideal.

The two options, as far as I can see, are:

  1. leave it up to developers to use what is supported
    • In this case I think a notice about platform compatibility should be added to the readme
  2. Use the 'intense' versions of these colours (they work)
    • Possibility of only using if on windows (although that will make chalk messy which is something I think you are very keen to avoid)
    • changes '\x1b[35m' to '\x1b[95m'

In addition to those colours italic, underline, inverse and strikethrough do not work on windows so I think something in the readme should note that.

@danielchatfield
Copy link
Author

ANSI codes aren't supported on windows, node intercepts them and calls the relevant windows API (where one exists).

Powershell has a deep blue background colour by default and I suppose some Microsoft dev decided that since on windows you can only set the background to 16 different colours using the existing API they would have to redefine one of those colours as the deep blue. Quite why they didn't just implement an API that allows the entire spectrum like every other terminal, or even better: support ANSI codes, I don't know.

I can't wait to get a new MacBook Pro, as much as I love Windows it is a complete pain to develop on.

@sindresorhus
Copy link
Member

Oh, Windows...

I can't wait to get a new MacBook Pro, as much as I love Windows it is a complete pain to develop on.

Believe you me it's a complete pain for tool creators too...

In addition to those colours italic, underline, inverse and strikethrough do not work on windows so I think something in the readme should note that.

Do they just not show or is the color escape shown?

This is more of a Node core issue and I encourage you to open a ticket there if there isn't already a ticket for it. I'm surprised this haven't come up before seeing as Node is a couple of years old.

@danielchatfield
Copy link
Author

Do they just not show or is the color escape shown?

They just don't show (node removes the color escape)

This is more of a Node core issue

I opened an issue on the relevant part of node (joyent/libuv#881) but this issue isn't just with node - trying to do the same thing with python will produce the same results so I think it's just one of those windows things and the best way to combat it is to use the bold magenta for large portions of text (it is ok for really small things as it sets the background to black so it is just about readable (example taken from update-notifier):
terminal_screen

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

No branches or pull requests

2 participants