Console background color has strange behavior when changed from a program #8144
Labels
Area-Output
Related to output processing (inserting text into buffer, retrieving buffer text, etc.)
Issue-Bug
It either shouldn't be doing this or needs an investigation.
Priority-2
A description (P2)
Product-Terminal
The new Windows Terminal.
Resolution-By-Design
It's supposed to be this way. Sometimes for compatibility reasons.
Resolution-Duplicate
There's another issue on the tracker that's pretty much the same thing.
Milestone
Environment
Steps to reproduce
Take a program that changes the console background using Win32 API calls like the following, and execute it several times:
Expected behavior
When a background color is set and then a text shorter than the console width is written followed by a newline, the remaining background color until the right margin should be transparent (showing the underlying console's background - black by default or whatever background color the user has configured), as it happens in cmd consoles; or even filling with the same color that was just set previously from the app could be acceptable.
Actual behavior
The wrong behavior described thereafter does not happen all the time, the first time that a new console is opened or after executing the cls command the behavior is right, but after a few executions (less than 10) the wrong behavior begins.
The wrong behavior consists in that after a background color change the next time that a newline is written , the remaining background color until the right margin is filled with the background color that was set previous to the last color change (n-1), and then after this it behaves normally (like cmd, not filled with a solid color).
When the program execution finishes, the background color of the last empty line is drawn with the last color that was set, but this is inconsistent with the behavior of the previous lines (it should be transparent).
The text was updated successfully, but these errors were encountered: