Skip to content

Add support for 8- and 24-bit ANSI escape color codes in the debug console#70935

Merged
isidorn merged 11 commits intomicrosoft:masterfrom
iansan5653:master
Mar 29, 2019
Merged

Add support for 8- and 24-bit ANSI escape color codes in the debug console#70935
isidorn merged 11 commits intomicrosoft:masterfrom
iansan5653:master

Conversation

@iansan5653
Copy link
Contributor

Adds support and tests for advanced color codes in the debug console output. Closes #67217.

Sorry for the large commits; I accidentally screwed up my fork's commit history pretty badly so it was simpler just to start from scratch. Let me know if anything needs clarification.

@isidorn isidorn self-assigned this Mar 22, 2019
@isidorn isidorn added this to the March 2019 milestone Mar 22, 2019
@isidorn
Copy link
Collaborator

isidorn commented Mar 22, 2019

@iansan5653 first of all thanks for your PR.
Overall it looks good. I have left some comments directly in the code. Please address those and than we can look into merging this PR.

Also have you tested that this fixes this issue
@DanTup since it is your issue originally, can you checkout this PR and verify your issue gets fixed? Thanks

Thanks a lot!

@isidorn isidorn removed this from the March 2019 milestone Mar 22, 2019
@isidorn
Copy link
Collaborator

isidorn commented Mar 25, 2019

@iansan5653 this is good work.
However this week we are in endgame which means we only take a limited set of changes before we release.
Bottom line: I will merge this in next week and it will be available as part of the April release in more than a month.

@isidorn isidorn added this to the April 2019 milestone Mar 25, 2019
@DanTup
Copy link
Contributor

DanTup commented Mar 25, 2019

I had a quick test of this, and it seems like the foreground works, but the background does not.

For ex., this node coed:

const t1 = "\x1B[32m       test   \x1B[0m";
const t2 = "\x1B[38;5;2m   test   \x1B[0m";
const t3 = "\x1B[42m       test   \x1B[0m";
const t4 = "\x1B[48;5;2m   test   \x1B[0m";
console.log(t1);
console.log(t2);
console.log(t3);
console.log(t4);

Looks like this in the terminal:

image

But like this in the Debug Console:

image

(I'm not sure if it's expected that the colours are slightly different too?)

@isidorn
Copy link
Collaborator

isidorn commented Mar 25, 2019

@iansan5653 can comment on that one @DanTup

@iansan5653
Copy link
Contributor Author

@DanTup That's odd; I'll look into it.

As far as the colors being slightly different, that should be solved by #70969.

@iansan5653
Copy link
Contributor Author

@DanTup Can you try it now? I had overlooked a comparison when I changed the isForeground boolean to the colorType string.

@iansan5653
Copy link
Contributor Author

Looks like that also fixed a failing test I had so the build is only failing due to an unrelated issue with the main codebase.

@DanTup
Copy link
Contributor

DanTup commented Mar 25, 2019

LGTM, thanks!

image

@isidorn
Copy link
Collaborator

isidorn commented Mar 25, 2019

@DanTup thanks for verifying
@iansan5653 yes the build fails due to unrelated errors.

Let's keep this as is and I will merge next week. Thanks!

@iansan5653
Copy link
Contributor Author

Here's a full test file in case anyone wants to try it themselves.
https://gist.github.com/iansan5653/c4a0b9f5c30d74258c5f132084b78db9

@isidorn isidorn merged commit bcbf1ca into microsoft:master Mar 29, 2019
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Debug Console ignores colors if in 8-bit/256-color format

3 participants