mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2026-12-01 22:19:27 -06:00
Some compilers (such as `gcc` and `rustc`) support emitting hyperlinks to the documentation for error messages and/or warnings. This PR adds a parser for the respective `OSC 8` ANSI escape sequence (see https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda) and makes them clickable in the output window. For example: https://godbolt.org/z/o1v7WzPc6 For GCC, this would make `-Wreturn-type` a clickable link to https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/Warning-Options.html#index-Wno-return-type. For Rust, this would make `E0425` a clickable link to https://doc.rust-lang.org/error_codes/E0425.html. Note that this also applies to execution output. A malicious program could (when executed) produce output that contains clickable links to anything. Related feature requests: * #5284 for `rustc` (`-Z terminal-urls=yes`) * #7310 for `gcc` (`-fdiagnostics-urls=always`)