You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I often run into <foo http://example.com> in my terminal and would like to open http://example.com in hints mode. This matches http://example.com> which is an invalid URL.
I propose that URL matching should only consider valid URI characters.
Note that the current logic is at https://github.com/kovidgoyal/kitty/blob/master/kittens/hints/marks.go#L248C90-L248C104 which expands to (?:gopher|http|ircs|mailto|news|ssh|ftps|https|ftp|gemini|git|sftp|file|irc|kitty)://[^\x00-\x09\x0b-\x0c\x0e-\x20\x7f-\xa0\xad\x{600}-\x{605}\x{61c}\x{6dd}\x{70f}\x{890}-\x{891}\x{8e2}\x{1680}\x{180e}\x{2000}-\x{200f}\x{2028}-\x{202f}\x{205f}-\x{2064}\x{2066}-\x{206f}\x{3000}\x{d800}-\x{f8ff}\x{feff}\x{fff9}-\x{fffb}\x{110bd}\x{110cd}\x{13430}-\x{1343f}\x{1bca0}-\x{1bca3}\x{1d173}-\x{1d17a}\x{e0001}\x{e0020}-\x{e007f}\x{f0000}-\x{ffffd}\x{100000}-\x{10fffd}]{3,}
Is your feature request related to a problem? Please describe.
I often run into
<foo http://example.com>
in my terminal and would like to open http://example.com in hints mode. This matcheshttp://example.com>
which is an invalid URL.Describe the solution you'd like
The allowed URI characters are described in https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#Syntax. This excludes
>
as an allowed character.I propose that URL matching should only consider valid URI characters.
Note that the current logic is at https://github.com/kovidgoyal/kitty/blob/master/kittens/hints/marks.go#L248C90-L248C104 which expands to
(?:gopher|http|ircs|mailto|news|ssh|ftps|https|ftp|gemini|git|sftp|file|irc|kitty)://[^\x00-\x09\x0b-\x0c\x0e-\x20\x7f-\xa0\xad\x{600}-\x{605}\x{61c}\x{6dd}\x{70f}\x{890}-\x{891}\x{8e2}\x{1680}\x{180e}\x{2000}-\x{200f}\x{2028}-\x{202f}\x{205f}-\x{2064}\x{2066}-\x{206f}\x{3000}\x{d800}-\x{f8ff}\x{feff}\x{fff9}-\x{fffb}\x{110bd}\x{110cd}\x{13430}-\x{1343f}\x{1bca0}-\x{1bca3}\x{1d173}-\x{1d17a}\x{e0001}\x{e0020}-\x{e007f}\x{f0000}-\x{ffffd}\x{100000}-\x{10fffd}]{3,}
Describe alternatives you've considered
There is an existing feature https://sw.kovidgoyal.net/kitty/conf/#opt-kitty.url_excluded_characters which handles URL under the cursor. Ideally, there would be synergy between URLs in hints-mode and URLs-under-cursor, but it appears there currently isn't.
Additionally, I think URL matching only valid URL characters is a reasonable default behavior.
The text was updated successfully, but these errors were encountered: