GNOME Bugzilla – Bug 637134
Last character is not included in URL for some URLs
Last modified: 2016-02-21 15:21:51 UTC
If I have http://aa.bb/c in the terminal then the latest c is not included in the URL on mouse hover, so just http://aa.bb/ is recognized as URL.
Confirmed. Happens when there's only one character after the last slash.
More interestingly, such URLs are not highlighted at all (not even up to the last "/") if the mouse enters from the right.
The regex definition (PATHTERM_CLASS and URLPATH) in g-t/src/terminal-screen.c are the source of problem. In URLPATH if there's at least one character following the "/" then it's swallowed by the first PATHCHARS_CLASS, and then at least one other character is required for the trailing PATHTERM_CLASS. Other issues I'm not sure about: URLPATH seems to contain a "loop" for matching all path components separately, yet PATHCHARS_CLASS also contains an embedded "/". It's not a problem per se, but I'm not sure about the intent. PATHTERM_CLASS seems to exclude only a few characters, meaning that e.g. a lone "(" (or many other characters) at the URL is considered part of it, but subsequent characters aren't, which is not ideal. I can't even see the purpose of PATHTERM_CLASS, I mean why do the valid characters in the last position differ from any other position? I randomly found this: http://mail.xfce.org/pipermail/xfce4-dev/2013-July/030398.html Updating the two aforementioned classes that this patch changes seems to fix the problem. I haven't studied their regexps. I'm clueless about the reason for the behavior mentioned in my previous comment. Perhaps it's about Vte incorrectly caching the negative result of failed regex match attempt.
(off: comment 2 is fixed in bug 754949)
Fixed with the URL regex rewrite from bug 756038.