Broken ctrl-click with dash in domain name
- iTerm2 version: Build 3.0.20160928
- OS version: 10.12.1
Detailed steps to reproduce the problem:
- write an URL with a dash in the domain part, e.g. https://paste.pound-python.org
- right-click on the right part of the URL, e.g. on "python" or "org" in the example
What happened: iTerm only selects parts of the URL thus resulting in a non-working link
What should have happened: The whole link should have been selected.
The issue has slightly different behaviors, using the following list:
- https://paste.pound-python.
- https://paste.pound-python.org
- https://paste.pound-python.org/
- https://paste.pound-python.org/show
this happens:
- first link is correctly selected, even if it has a dash and a trailing dot;
- second link only highlights up to the dash going left, so "python.org" in this case;
- third link hightlights "python.org" if right-click happens on any of those characters, if right click happens on trailing slash the whole link is correctly highlighted;
- fourth link hightlights up to the first slash of the protocol (even if clicking in the particular spot of previous example) so "/paste.pound-python.org/show", this makes the system unable to handle the URL.
The erratic and quite different behavior made me think it was a matter of the regular expression used to match the URL but I wasn't able to figure how those corner cases are handled, I see the dash in all the match groups for the domain name parts.