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

Propagate palette changes on the legacy console through ConPTY w/ OSC 4 #2985

Open
manups4e opened this issue Sep 30, 2019 · 8 comments
Open
Labels
Area-VT Virtual Terminal sequence support Help Wanted We encourage anyone to jump in on these. Issue-Task It's a feature request, but it doesn't really need a major design. Product-Conpty For console issues specifically related to conpty
Milestone

Comments

@manups4e
Copy link

Environment

Windows build number: Microsoft Windows [Versione 10.0.18362.356]
Windows Terminal version (if applicable): 0.5.2681.0

Any other software?
FiveM CitizenFX collective GTA Modification server Build

Steps to reproduce

using the library Colorful.Console in a c# project the output color in console is different from the color requested and in the original CMD color is correctly interpreted

Expected behavior

i expect colors to be shown correctly

Actual behavior

Colors are not correctly shown

image

image

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Sep 30, 2019
@skyline75489
Copy link
Collaborator

It seems a color scheme difference to me, instead of a bug.

@manups4e
Copy link
Author

i see

@zadjii-msft
Copy link
Member

@manups4e could you share your profiles.json?

Part of it looks like it might be a different colorscheme, but Colorful.Console looks like it's setting the color table to achieve these colors:

Colorful.Console can only write to the console in 16 different colors (including the black that's used as the console's background, by default!) in a single console session. This is a limitation of the Windows console itself (ref: MSDN), and it's one that I wasn't able to work my way around. If you know of a workaround, let me know!

So what's probably happening is we're failing to render color table changes through conpty.

@zadjii-msft zadjii-msft added Area-VT Virtual Terminal sequence support Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-2 A description (P2) Product-Conpty For console issues specifically related to conpty labels Sep 30, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Sep 30, 2019
@zadjii-msft zadjii-msft added this to the 20H1 milestone Sep 30, 2019
@manups4e
Copy link
Author

here :) well.. right now i'm using it on normal cmd and it works
profiles.zip

@DHowett-MSFT DHowett-MSFT modified the milestones: 20H1, 21H1 Sep 30, 2019
@DHowett-MSFT DHowett-MSFT added Priority-3 A description (P3) and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Priority-2 A description (P2) labels Sep 30, 2019
@zadjii-msft
Copy link
Member

zadjii-msft commented Sep 30, 2019

This might also be related to the upstream tomakita/Colorful.Console#24

@manups4e
Copy link
Author

manups4e commented Oct 1, 2019

well.. preinstalled cmd works as intended

@j4james
Copy link
Collaborator

j4james commented Jun 27, 2020

FYI, I can confirm that the problem is indeed the console color table changes not being passed on. I hacked together a POC that checked for conpty mode in the ApiRoutines::SetConsoleScreenBufferInfoExImpl method, and then forwarded any color table changes as OSC 4 VT sequences, and that seemed to get all the colors rendering correctly. There's a limit to how many colors you can have at the same time, but that's to be expected.

@DHowett
Copy link
Member

DHowett commented Aug 13, 2020

I'm going to transform this into a task and give it a better title: "Propagate palette changes on the legacy console through ConPTY w/ OSC 4"

@DHowett DHowett added Issue-Task It's a feature request, but it doesn't really need a major design. and removed Issue-Bug It either shouldn't be doing this or needs an investigation. labels Aug 13, 2020
@DHowett DHowett changed the title Colors are not correctly interpeted Propagate palette changes on the legacy console through ConPTY w/ OSC 4 Aug 13, 2020
@DHowett DHowett added Help Wanted We encourage anyone to jump in on these. and removed Priority-3 A description (P3) labels Aug 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-VT Virtual Terminal sequence support Help Wanted We encourage anyone to jump in on these. Issue-Task It's a feature request, but it doesn't really need a major design. Product-Conpty For console issues specifically related to conpty
Projects
None yet
Development

No branches or pull requests

6 participants