Modern versions of windows (after windows 10 v1511) support VT100 escape
sequences, so translation for them is not necessary. The translation also
mangles embedded warning documentation links.
gcc/ChangeLog:
* pretty-print.cc (mingw_ansi_fputs): Don't translate escape sequences
if
the console has ENABLE_VIRTUAL_TERMINAL_PROCESSING.
Signed-off-by: Peter Damianov
---
gcc/pretty-print.cc | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/gcc/pretty-print.cc b/gcc/pretty-print.cc
index eb59bf424b7..98b6410d6e4 100644
--- a/gcc/pretty-print.cc
+++ b/gcc/pretty-print.cc
@@ -674,8 +674,10 @@ mingw_ansi_fputs (const char *str, FILE *fp)
/* Don't mess up stdio functions with Windows APIs. */
fflush (fp);
- if (GetConsoleMode (h, ))
-/* If it is a console, translate ANSI escape codes as needed. */
+ if (GetConsoleMode (h, ) && !(mode &
ENABLE_VIRTUAL_TERMINAL_PROCESSING))
+/* If it is a console, and doesn't support ANSI escape codes, translate
+ * them as needed.
+ */
for (;;)
{
if ((esc_code = find_esc_head (_len, _head, read)) == 0)
--
2.39.2