1
0
Fork 0
mirror of https://github.com/alacritty/alacritty.git synced 2025-04-14 17:53:03 -04:00

Add backslash to invalid characters for URL regex

This adds the `\` character to the list of characters which will
terminate matches in Alacritty's default hint for URL recognition.
This commit is contained in:
Kaylem Brown-Malone 2025-01-28 18:29:22 -07:00 committed by GitHub
parent 5e78d20c70
commit 5b189bca68
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 2 deletions

View file

@ -13,6 +13,7 @@ Notable changes to the `alacritty_terminal` crate are documented in its
### Changed
- Error out when socket fails to create with `--daemon`
- Default URL hints now stop before backslashes
### Fixed

View file

@ -37,7 +37,7 @@ use crate::config::LOG_TARGET_CONFIG;
/// Regex used for the default URL hint.
#[rustfmt::skip]
const URL_REGEX: &str = "(ipfs:|ipns:|magnet:|mailto:|gemini://|gopher://|https://|http://|news:|file:|git://|ssh:|ftp://)\
[^\u{0000}-\u{001F}\u{007F}-\u{009F}<>\"\\s{-}\\^⟨⟩`]+";
[^\u{0000}-\u{001F}\u{007F}-\u{009F}<>\"\\s{-}\\^⟨⟩`\\\\]+";
#[derive(ConfigDeserialize, Default, Clone, Debug, PartialEq)]
pub struct UiConfig {

View file

@ -740,7 +740,8 @@ post_processing = _true_++
persist = _false_++
mouse.enabled = _true_++
binding = { key = _"O"_, mods = _"Control|Shift"_ }++
regex = _"(ipfs:|ipns:|magnet:|mailto:|gemini://|gopher://|https://|http://|news:|file:|git://|ssh:|ftp://)[^\\u0000-\\u001F\\u007F-\\u009F<>\\"\\\\s{-}\\\\^⟨⟩`]+"_
regex =
_"(ipfs:|ipns:|magnet:|mailto:|gemini://|gopher://|https://|http://|news:|file:|git://|ssh:|ftp://)[^\\u0000-\\u001F\\u007F-\\u009F<>\\"\\\\s{-}\\\\^⟨⟩`\\\\\\\\]+"_
# KEYBOARD