]> git.ipfire.org Git - thirdparty/gcc.git/commit
diagnostics: Don't hardcode auto_enable_urls to false for mingw hosts
authorPeter Damianov <peter0x44@disroot.org>
Mon, 3 Jun 2024 17:07:09 +0000 (10:07 -0700)
committerJonathan Yong <10walls@gmail.com>
Sun, 16 Jun 2024 01:40:05 +0000 (01:40 +0000)
commit5c662a3a5724b75ceb06496d9c64137d59c89d39
treea1324eb52467211c0c41b1855df7cecac571a269
parente943a5da40cd4799908d3d29001e1325eb00b755
diagnostics: Don't hardcode auto_enable_urls to false for mingw hosts

Windows terminal and mintty both have support for link escape sequences, and so
auto_enable_urls shouldn't be hardcoded to false. For older versions of the
windows console, mingw_ansi_fputs's console API translation logic does mangle
these sequences, but there's nothing useful it could do even if this weren't
the case, so check if the ansi escape sequences are supported at all.

conhost.exe doesn't support link escape sequences, but printing them does not
cause any problems.

gcc/ChangeLog:
* diagnostic-color.cc (auto_enable_urls): Don't hardcode to return
false on mingw hosts.
(auto_enable_urls): Return true if console
supports ansi escape sequences.

Signed-off-by: Peter Damianov <peter0x44@disroot.org>
gcc/diagnostic-color.cc