Skip to content

Painting issue with COMMON_LVB_UNDERSCORE in 1703 onwards #47

@dra27

Description

@dra27

COMMON_LVB_UNDERSCORE seems to paint unreliably since Windows 10 1703 (10.0.15063) and it's still present in 10.0.17063.1000 on the fast insider ring.

Compile and run the following program multiple times from a new command prompt (I've only tried it on x64 installations):

#include <windows.h>
#include <stdio.h>

int main(void) {
  HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
  CONSOLE_SCREEN_BUFFER_INFO info;
  GetConsoleScreenBufferInfo(hConsole, &info);
  SetConsoleTextAttribute(hConsole, COMMON_LVB_UNDERSCORE | info.wAttributes);
  printf("COMMON_LVB_UNDERSCORE added to console text attributes\n");
  fflush(stdout);
  printf("Hello world\n");
  fflush(stdout);
  SetConsoleTextAttribute(hConsole, info.wAttributes);
}

The expected output is two lines of text both underlined. On my 1703 box, the first line is never underlined and, randomly, neither was the second on one run. Scroll the console to move the lines off-screen and scroll it back and the lines reappear.

Note that you have to scroll the console text itself out of the viewport and back in - moving another window over the top of the console and then off does not cause the underlining to reappear. The effect occurs regardless of whether the program is run from the machine directly or via remote desktop.

Metadata

Metadata

Assignees

Labels

Product-ConhostFor issues in the Console codebaseResolution-Fix-AvailableIt's available in an Insiders build or a release

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions