diff options
author | Peter Damianov <peter0x44@disroot.org> | 2024-06-03 10:07:10 -0700 |
---|---|---|
committer | Jonathan Yong <10walls@gmail.com> | 2024-06-16 01:40:26 +0000 |
commit | bc630d613db94eb50687a009ae6b45098ab02db5 (patch) | |
tree | c997a3530455f2648becb991dc001a958f1ea16d /gcc | |
parent | 5c662a3a5724b75ceb06496d9c64137d59c89d39 (diff) | |
download | gcc-bc630d613db94eb50687a009ae6b45098ab02db5.zip gcc-bc630d613db94eb50687a009ae6b45098ab02db5.tar.gz gcc-bc630d613db94eb50687a009ae6b45098ab02db5.tar.bz2 |
pretty-print: Don't translate escape sequences to windows console API
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 <peter0x44@disroot.org>
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/pretty-print.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/pretty-print.cc b/gcc/pretty-print.cc index 639e2b8..ec44172 100644 --- a/gcc/pretty-print.cc +++ b/gcc/pretty-print.cc @@ -674,8 +674,9 @@ mingw_ansi_fputs (const char *str, FILE *fp) /* Don't mess up stdio functions with Windows APIs. */ fflush (fp); - if (GetConsoleMode (h, &mode)) - /* If it is a console, translate ANSI escape codes as needed. */ + if (GetConsoleMode (h, &mode) && !(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 (&prefix_len, &esc_head, read)) == 0) |