MCPcopy
hub / github.com/docker/compose / OSC8Link

Function OSC8Link

cmd/formatter/ansi.go:101–106  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

99// underline styling, making it clickable in supported terminal emulators.
100// When ANSI output is disabled, returns the plain text without escape sequences.
101func 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}

Callers 5

hintLinkFunction · 0.92
TestOSC8LinkFunction · 0.85

Calls

no outgoing calls

Tested by 4

TestOSC8LinkFunction · 0.68