Starting another process causes underlining to disappear #48

Closed
opened 2026-01-30 21:40:37 +00:00 by claunia · 2 comments
Owner

Originally created by @dra27 on GitHub (Jan 8, 2018).

This seems to be present since RTM (tried on 1503, 1511, 1607, 1703, 1709 and fast insiders ring).

Run any program from a command prompt which displays underlined text (for example, the program in #47), but also using the 1511 ANSI support:

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

int main(int argc, char** argv) {
  HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
  DWORD dwMode;
  GetConsoleMode(hConsole, &dwMode);
  SetConsoleMode(hConsole, dwMode | ENABLE_VIRTUAL_TERMINAL_PROCESSING);
  printf("\e[4mHello world\e[0m\n");
  SetConsoleMode(hConsole, dwMode);
}

Running this a few times gets some lines of text on the console which are underlined. I noticed when running some other processes that underlining from previous text temporarily disappears while they're running (for example, the pscp command from the PuTTY suite or OCaml's toplevel prompt ocaml). When those processes exit, the underlining of the previous text suddenly reappears.

If you then enter cmd to start a nested interpreter, then the underlining disappears from the previous text permanently (i.e. it doesn't even reappear when you type exit from the nested interpreter).

I'm not aware of any of those programs intentionally manipulating the attributes of the console cells, so I think it's reasonable to expect that the underlining should be persisting!

Originally created by @dra27 on GitHub (Jan 8, 2018). This seems to be present since RTM (tried on 1503, 1511, 1607, 1703, 1709 and fast insiders ring). Run any program from a command prompt which displays underlined text (for example, the program in #47), but also using the 1511 ANSI support: ```c #include <windows.h> #include <stdio.h> int main(int argc, char** argv) { HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); DWORD dwMode; GetConsoleMode(hConsole, &dwMode); SetConsoleMode(hConsole, dwMode | ENABLE_VIRTUAL_TERMINAL_PROCESSING); printf("\e[4mHello world\e[0m\n"); SetConsoleMode(hConsole, dwMode); } ``` Running this a few times gets some lines of text on the console which are underlined. I noticed when running some other processes that underlining from previous text temporarily disappears while they're running (for example, the `pscp` command from the PuTTY suite or OCaml's toplevel prompt `ocaml`). When those processes exit, the underlining of the previous text suddenly reappears. If you then enter `cmd` to start a nested interpreter, then the underlining disappears from the previous text permanently (i.e. it doesn't even reappear when you type `exit` from the nested interpreter). I'm not aware of any of those programs intentionally manipulating the attributes of the console cells, so I think it's reasonable to expect that the underlining should be persisting!
Author
Owner

@zadjii-msft commented on GitHub (Jan 11, 2018):

I'm gonna close this issue because it's basically a dupe of #47.

@zadjii-msft commented on GitHub (Jan 11, 2018): I'm gonna close this issue because it's basically a dupe of #47.
Author
Owner

@dra27 commented on GitHub (Jan 11, 2018):

Your call, as the keeper of the code, obviously! The only thing from my perspective is that this one affects all releases of Windows 10 but #48 is only 1703+

@dra27 commented on GitHub (Jan 11, 2018): Your call, as the keeper of the code, obviously! The only thing from my perspective is that this one affects all releases of Windows 10 but #48 is only 1703+
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#48