-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hyperlink support #6
Comments
The current workaround is to have a regex: var ansiLinkRe = regexp.MustCompile(`(?m)\x1b]8;;([^\x1b]*)\x1b\\([^\x1b]*)\x1b]8;;\x1b\\`) Then do |
Apologies for the delay in getting back to you. Do you have more information about "terminal links" as I'm not aware of them? My instinct is that as a library, it shouldn't try to derive any semantic meaning from the input, but I'm keen to understand more about this use case. |
I can't find any standard page that I can link, but searching "OSC 8 Terminal" should give a bunch of results on hyperlink support in various terminals. |
This looks great. Happy to accept a PR for this if you're willing to do it 👍 |
Right now, go-ansi-parser's
ansi.Length
includes the URL part of a terminal hyperlink. This makes the line count super long even when it's visibly just a small piece of text.ansi.Length
should ideally only return the visible text component of a hyperlink.Example:
For string:
"\x1b[33;1mSource Code: \x1b[0m\x1b]8;;https://libdb.so/libdb.so\x1b\\diamondburned/libdb.so\x1b]8;;\x1b\\"
ansi.Length(str)
should return 35 (probably maybe?), but it currently returns 74.The text was updated successfully, but these errors were encountered: