OSC8Link wraps text in an OSC 8 terminal hyperlink escape sequence with underline styling, making it clickable in supported terminal emulators. When ANSI output is disabled, returns the plain text without escape sequences.
(url, text string)
| 99 | // underline styling, making it clickable in supported terminal emulators. |
| 100 | // When ANSI output is disabled, returns the plain text without escape sequences. |
| 101 | func OSC8Link(url, text string) string { |
| 102 | if disableAnsi { |
| 103 | return text |
| 104 | } |
| 105 | return "\033]8;;" + url + "\033\\\033[4m" + text + "\033[24m\033]8;;\033\\" |
| 106 | } |
no outgoing calls