1 parent c74d1e6 commit d879d4dCopy full SHA for d879d4d
2 files changed
Sources/SwiftTerm/Terminal.swift
@@ -7423,7 +7423,6 @@ open class Terminal {
7423
let pathChars = #"[\w\-.~:\/?#@!$&*+;=%]"#
7424
let noTrailingPunctuation = #"(?<![,.])"#
7425
let noTrailingColon = #"(?<!:)"#
7426
- let trailingSpacesAtEOL = #"(?: +(?= *$))?"#
7427
let dottedPathLookahead = #"(?=[\w\-.~:\/?#@!$&*+;=%]*\.)"#
7428
let nonDottedPathLookahead = #"(?![\w\-.~:\/?#@!$&*+;=%]*\.)"#
7429
let dottedPathSpaceSegments = #"(?:(?<!:) (?!\w+:\/\/)[\w\-.~:\/?#@!$&*+;=%]*[\/.])*"#
@@ -7459,13 +7458,11 @@ open class Terminal {
7459
7458
pathChars + "+" +
7460
dottedPathSpaceSegments +
7461
noTrailingColon +
7462
- trailingSpacesAtEOL +
7463
"|" +
7464
nonDottedPathLookahead +
7465
7466
anyPathSpaceSegments +
7467
7468
7469
")"
7470
7471
// Ghostty uses (?<!\$\d*) here, which is unsupported by ICU.
@@ -7476,8 +7473,7 @@ open class Terminal {
7476
7473
bareRelativePathPrefix +
7477
7474
7478
7475
7479
- noTrailingColon +
7480
- trailingSpacesAtEOL
+ noTrailingColon
7481
7482
let regex = schemeURLBranch + "|" + rootedOrRelativePathBranch + "|" + bareRelativePathBranch
7483
return try? NSRegularExpression(pattern: regex, options: [])
Tests/SwiftTermTests/GhosttyImplicitLinkDetectionTests.swift
@@ -76,7 +76,7 @@ final class GhosttyImplicitLinkDetectionTests: TerminalDelegate {
76
("IPv6 address https://[2001:db8::1]:8080/path", "https://[2001:db8::1]:8080/path"),
77
("IPv6 address https://[2001:db8::1]:8080(foo)", "https://[2001:db8::1]:8080"),
78
("../example.py", "../example.py"),
79
- ("../example.py ", "../example.py "),
+ ("../example.py ", "../example.py"),
80
("first time ../example.py contributor ", "../example.py"),
81
("src/config/url.zig", "src/config/url.zig"),
82
("app/folder/file.rb:1", "app/folder/file.rb:1"),
@@ -90,7 +90,7 @@ final class GhosttyImplicitLinkDetectionTests: TerminalDelegate {
90
(" - shared/src/foo/SomeItem.m:12, shared/src/", "shared/src/foo/SomeItem.m:12"),
91
("foo.local/share", "foo.local/share"),
92
("2024/report.txt", "2024/report.txt"),
93
- ("./spaces-end. ", "./spaces-end. "),
+ ("./spaces-end. ", "./spaces-end."),
94
("./space middle", "./space middle")
95
]
96
0 commit comments