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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect colours and styles from git bash on Windows #15

Closed
olivif opened this issue Dec 19, 2015 · 16 comments
Closed

Incorrect colours and styles from git bash on Windows #15

olivif opened this issue Dec 19, 2015 · 16 comments
Assignees
Labels

Comments

@olivif
Copy link

olivif commented Dec 19, 2015

image

I will investigate how this can be made better for Windows and follow up on here 馃槂

@IonicaBizau
Copy link
Owner

@olivif Thanks! Should you have any questions, let me know! 馃榿

@olivif
Copy link
Author

olivif commented Dec 20, 2015

So, after some quick investigations, here's what I found 馃槃

This line is the culprit to some of the windows issues

, fg: ["\u001b[38;5;", "\u001b[39m"]

It seems like on windows cmd that string is interpreted differently.

I made a quick prototype and it seems to work.
image

It seems like node-couleurs supports any hex/rgb code, so we would probably need a way of mapping that to this list ..

Also, it seems like this is a pretty solved problem on both colors.js and chalk.

@IonicaBizau
Copy link
Owner

@olivif 馃榿

Does Windows cmd support 256 colors like UNIX/Linux terminals do?
If that is so, I wonder if x256 works smoothly on Windows.

From what I saw, colors.js and chalk don't support hex color input.

@IonicaBizau
Copy link
Owner

@olivif Any news on this?

@olivif
Copy link
Author

olivif commented Feb 20, 2016

I had a look, x256 doesn't work very well on windows either 馃槮

@IonicaBizau IonicaBizau self-assigned this Mar 2, 2016
@IonicaBizau
Copy link
Owner

I'm on it. 馃殌

@IonicaBizau
Copy link
Owner

馃殺 6.0.0 馃帀 /cc #17

Using ansy, we try to get the best support for the rgb/hex colors, in this order: 16m colors, 256 colors, 16 colors, no colors. 馃槀

@olivif
Copy link
Author

olivif commented Mar 2, 2016

@IonicaBizau great stuff! much better

image

@IonicaBizau
Copy link
Owner

@olivif For posterity: the Windows command prompt does not support 256 colors. It supports only 16 colors. I'm wondering how the new version of image-to-ascii (currently in the lwip branch) works in Windows cmd. 馃槃

@olivif
Copy link
Author

olivif commented Mar 2, 2016

npm install imgpx fails miserably on my windows machine, I think I have a newer version of the cpp compiler and it really doesn't like it. So I wasn't able to try it 馃槃

@IonicaBizau
Copy link
Owner

@olivif Do you have Visual Studio 2013 on your machine? I guess lwip fails to be compiled.

@olivif
Copy link
Author

olivif commented Mar 2, 2016

Yes, that is the issue. It's because I only have 2015 installed.

@IonicaBizau
Copy link
Owner

@olivif Well, it aims to work with Visual Studio >= 2013. I'm thinking that maybe I should do it in the reverse way: if GraphicsMagic is not installed, then try to compile and use lwip. 馃榿

@olivif
Copy link
Author

olivif commented Mar 2, 2016

that could work 馃槃

@IonicaBizau
Copy link
Owner

@olivif I did it! There we go:

Don't forget to tell Microsoft to enable 16 million colors in Command Prompt. 馃槀

Here's how it works: lwipify uses lwip2. lwip2 checks if GM is installed and if not it tries to install lwip.

image-parser takes care of parsing the image (using lwip or gm, doesn't matter).

@olivif
Copy link
Author

olivif commented Mar 7, 2016

niiiiiice!!! 馃槃

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

No branches or pull requests

2 participants