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

Undeterministic glitches of text with colored background #2130

Closed
mcpiroman opened this issue Jul 27, 2019 · 3 comments
Closed

Undeterministic glitches of text with colored background #2130

mcpiroman opened this issue Jul 27, 2019 · 3 comments
Labels
Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@mcpiroman
Copy link
Contributor

Environment

bd5cae1

Steps to reproduce

Run program of this kind:

int main()
{
	cout << "\x1B[41m";
	cout << "X Red ";
	cout << "\x1B[42m";
	cout << "Green\n";
	cout << "\x1B[43m";
	cout << "Yellow ";
	cout << "\x1B[44m";
	cout << "Blue";
	cout << "\x1B[0m";
	return 0;
}

Expected behavior

image

Actual behavior

bug

@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 Jul 27, 2019
@j4james
Copy link
Collaborator

j4james commented Jul 27, 2019

Unless you have set the VirtualTerminalLevel registry setting, those escape sequences shouldn't be interpreted at all, so your program really shouldn't be displaying any colors. Try running it from a conhost shell to see what I mean.

However, because the Windows Terminal is passing your output through at conpty pipe, I suspect it's accidentally interpreting those escape sequences on the other side of the pipe, and that's when things start to go wrong.

I believe this is a know bug - issue #1965 describes a similar situation.

@DHowett-MSFT
Copy link
Contributor

Correct, this just looks like the same issue. If you use SetConsoleMode to turn on ENABLE_VIRTUAL_TERMINAL_PROCESSING explicitly, does it work fine?

@DHowett-MSFT DHowett-MSFT added Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Jul 29, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Jul 29, 2019
@mcpiroman
Copy link
Contributor Author

@DHowett-MSFT it does

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Projects
None yet
Development

No branches or pull requests

3 participants