diff --git a/pkg/gui/style/hyperlink.go b/pkg/gui/style/hyperlink.go new file mode 100644 index 000000000..0585e89a9 --- /dev/null +++ b/pkg/gui/style/hyperlink.go @@ -0,0 +1,13 @@ +package style + +import "fmt" + +// Render the given text as an OSC 8 hyperlink +func PrintHyperlink(text string, link string) string { + return fmt.Sprintf("\033]8;;%s\033\\%s\033]8;;\033\\", link, text) +} + +// Render a link where the text is the same as a link +func PrintSimpleHyperlink(link string) string { + return fmt.Sprintf("\033]8;;%s\033\\%s\033]8;;\033\\", link, link) +}