From fa9cf66fa204a84b0a35f41d430fdb91a542f761 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Tue, 9 Mar 2021 07:40:52 -0800 Subject: [PATCH] Add file:// to the default implicit hyperlink rule list closes: https://github.com/wez/wezterm/issues/525 --- config/src/lib.rs | 2 ++ docs/changelog.md | 1 + docs/hyperlinks.md | 10 +++++++--- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/config/src/lib.rs b/config/src/lib.rs index b2e559b98..08caf8573 100644 --- a/config/src/lib.rs +++ b/config/src/lib.rs @@ -1589,6 +1589,8 @@ fn default_hyperlink_rules() -> Vec { hyperlink::Rule::new(r"\b\w+://(?:[\w.-]+)\.[a-z]{2,15}\S*\b", "$0").unwrap(), // implicit mailto link hyperlink::Rule::new(r"\b\w+@[\w-]+(\.[\w-]+)+\b", "mailto:$0").unwrap(), + // file:// + hyperlink::Rule::new(r"\bfile://\S*\b", "$0").unwrap(), ] } diff --git a/docs/changelog.md b/docs/changelog.md index 19dbea09c..7619d2c27 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -95,6 +95,7 @@ brief notes about them may accumulate here. * New: Added [alternate_buffer_wheel_scroll_speed](config/lua/config/alternate_buffer_wheel_scroll_speed.md) option to control how many cursor key presses are generated by the mouse wheel when the alternate screen is active. The new default for this is a faster-than-previous-releases 3 lines per wheel tick. [#432](https://github.com/wez/wezterm/issues/432) * macOS: Dead Keys are now processed even when `use_ime=false`. [More details in the docs](config/keys.md#macos-left-and-right-option-key). [#410](https://github.com/wez/wezterm/issues/410). * X11: attempt to load cursors from the XCursor.theme resource specified on the root window [#524](https://github.com/wez/wezterm/issues/524) +* Added `file://` URL matching to the default list of implicit hyperlink rules [#525](https://github.com/wez/wezterm/issues/525) ### 20201101-103216-403d002d diff --git a/docs/hyperlinks.md b/docs/hyperlinks.md index 32281f304..9cd7327f1 100644 --- a/docs/hyperlinks.md +++ b/docs/hyperlinks.md @@ -22,13 +22,17 @@ return { format = "$0", }, - -- Un-comment this if you want to linkify email addresses - --[[ + -- linkify email addresses { regex = "\\b\\w+@[\\w-]+(\\.[\\w-]+)+\\b", format = "mailto:$0", }, - ]] + + -- file:// URI + { + regex = "\bfile://\S*\b", + format = "$0", + }, -- Make task numbers clickable --[[