about summary refs log tree commit diff
path: root/compiler/rustc_errors/src/lib.rs
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2023-02-09 10:16:00 +0000
committerEsteban Küber <esteban@kuber.com.ar>2023-02-09 14:52:54 +0000
commita576514e13d5608ab48847958c2b97ab5ab01d85 (patch)
tree4a7905999c7474e22fa4891d2522cc53690f12de /compiler/rustc_errors/src/lib.rs
parenta00e24d76a9ac03b146d3bf89e2161b2466c6551 (diff)
downloadrust-a576514e13d5608ab48847958c2b97ab5ab01d85.tar.gz
rust-a576514e13d5608ab48847958c2b97ab5ab01d85.zip
Introduce `-Zterminal-urls` to use OSC8 for error codes
Terminals supporting the OSC8 Hyperlink Extension can support inline
anchors where the text is user defineable but clicking on it opens a
browser to a specified URLs, just like `<a href="URL">` does in HTML.

https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
Diffstat (limited to 'compiler/rustc_errors/src/lib.rs')
-rw-r--r--compiler/rustc_errors/src/lib.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs
index ec04e865d53..83b733d4c06 100644
--- a/compiler/rustc_errors/src/lib.rs
+++ b/compiler/rustc_errors/src/lib.rs
@@ -573,6 +573,7 @@ impl Handler {
             None,
             flags.macro_backtrace,
             flags.track_diagnostics,
+            TerminalUrl::No,
         ));
         Self::with_emitter_and_flags(emitter, flags)
     }
@@ -1838,6 +1839,13 @@ pub fn add_elided_lifetime_in_path_suggestion(
     );
 }
 
+#[derive(Clone, Copy, PartialEq, Hash, Debug)]
+pub enum TerminalUrl {
+    No,
+    Yes,
+    Auto,
+}
+
 /// Useful type to use with `Result<>` indicate that an error has already
 /// been reported to the user, so no need to continue checking.
 #[derive(Clone, Copy, Debug, Encodable, Decodable, Hash, PartialEq, Eq, PartialOrd, Ord)]