On Thu, Dec 19, 2019 at 03:24:19PM -0500, David Malcolm wrote: > Currently -fdiagnostics-urls defaults to "auto" and this works > (e.g. for recent gnome-terminal, and is gracefully discarded by > konsole5), but there have been reports of incompatibilities of the > feature with various other terminals. > > This patch adds a configuration option to change this default, based > on Jakub's analogous change to -fdiagnostics-color (r217540). One > possible configure-time option is --with-diagnostics-urls=auto-if-env, > which adds support for a GCC_URLS environment variable to control > the default (again by analogy with the --with-diagnostics-color > configure-time support for changing -fdiagnostics-color).
I think it would be better to have GCC_URLS env var to be be more consistent with GCC_COLORS, so yes, have the never,auto,auto-if-env,always configure possibilities like for colors and for auto-if-env don't print URLS if the env var is not present, but on top of that, parse also the value of the env var like parse_gcc_colors does, and have a way to disable urls even with -fdiagnostics-urls=always (like GCC_COLORS= disables colors), and perhaps use the env var to select between the ST and BEL terminator as apparently some terminals like one or the other more. So perhaps accept GCC_URLS= and GCC_URLS=no as disabling, GCC_URLS=bel as the (default) case for BEL termination and GCC_URLS=st for the ST termination? E.g. have a way even for a compiler configured that it will work with new terminals most of them time and thus --with-diagnostics-urls=always that if somebody sshs to some machine from some old host, GCC_URLS=no (or none?) can be still used to disable it, without the need to tweak build system to inject there some flags. > Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu; I > tested the --with-diagnostics-urls=auto-if-env and GCC_URLS behavior > manually. > > Jakub: does this look sane to you? (given that this is heavily based > on your 2014 patches for --with-diagnostics-color). Jakub