diff --git a/assets/settings/default.json b/assets/settings/default.json index 0d1762ea2adffa245f8eca5e2e8de233e6ed328d..111b42cdcc561a046254305662c5bfc2f0916e6e 100644 --- a/assets/settings/default.json +++ b/assets/settings/default.json @@ -1797,15 +1797,15 @@ "(?x)", "(?", " (", - " # multi-char path: first char (not opening delimiter or space)", - " [^({\\[<\"'`\\ ]", + " # multi-char path: first char (not opening delimiter, space, or box drawing char)", + " [^({\\[<\"'`\\ \\u2500-\\u257F]", " # middle chars: non-space, and colon/paren only if not followed by digit/paren", " ([^\\ :(]|[:(][^0-9()])*", " # last char: not closing delimiter or colon", " [^()}\\]>\"'`.,;:\\ ]", " |", - " # single-char path: not delimiter, punctuation, or space", - " [^(){}\\[\\]<>\"'`.,;:\\ ]", + " # single-char path: not delimiter, punctuation, space, or box drawing char", + " [^(){}\\[\\]<>\"'`.,;:\\ \\u2500-\\u257F]", " )", " # optional line/column suffix (included in path for PathWithPosition::parse_str)", " (:+[0-9]+(:[0-9]+)?|:?\\([0-9]+([,:]?[0-9]+)?\\))?", diff --git a/crates/terminal/src/terminal_hyperlinks.rs b/crates/terminal/src/terminal_hyperlinks.rs index 5250dfb1a99cdff11da7fa75665801609ff50299..d239f680f9e2ecbd3d320e731d3cc74303a552ed 100644 --- a/crates/terminal/src/terminal_hyperlinks.rs +++ b/crates/terminal/src/terminal_hyperlinks.rs @@ -905,6 +905,23 @@ mod tests { ); } + #[test] + // + fn issue_46795() { + // Box drawing characters are commonly used as UI elements and + // should not interfere with path detection; they appear rarely + // enough in actual paths that false positives should be minimal + + test_path!("─‹«/👉test/cool.rs»:«4»:«2»›"); + test_path!("┤‹«/👉test/cool.rs»:«4»:«2»›"); + test_path!("╿‹«/👉test/cool.rs»:«4»:«2»›"); + + test_path!("└──‹«/👉test/cool.rs»:«4»:«2»›"); + test_path!("├─[‹«/👉test/cool.rs»:«4»:«2»›]"); + test_path!("─[‹«/👉test/cool.rs»:«4»:«2»›]"); + test_path!("┬‹«/👉test/cool.rs»:«4»:«2»›┬"); + } + #[test] #[cfg_attr( not(target_os = "windows"),