wire / terminal-osc / 8

OSC 8 — Hyperlinks (clickable links in terminal output)

OSC 8 marks a run of text as a clickable hyperlink: OSC 8 ; params ; URI ST link text OSC 8 ; ; ST. The opening sequence carries the target URI (and optional params like id=...); the closing sequence has empty params and empty URI to end the link. Specified by the Gnome VTE 'hyperlinks' proposal and supported across most modern terminals.

terminal-osc kind control-sequence status de-facto verification verified tier C terminal-escape@1

aka: terminal hyperlinks · clickable links · OSC 8 · ESC ] 8 · hyperlinks in terminal emulators

frame

OSC introducer: \x1b] ESC ] (0x1B 0x5D)

terminator (ST|BEL): ST \x1b\ · BEL \x07

parameters / subcommands

idnamebytes (ST)meaning
open Open hyperlink \x1b]8;;https://example.com\x1b\ OSC 8 ; params ; URI ST begins a hyperlink. params is a possibly-empty list of key=value pairs separated by ':' (the only standardized key is 'id', used to group multi-line links). URI is the target (e.g. https://..., file://...). The text printed AFTER this sequence and BEFORE the closing sequence is the clickable link text.
close Close hyperlink \x1b]8;;\x1b\ OSC 8 ; ; ST (empty params AND empty URI) ends the current hyperlink. Text after this is no longer part of the link.

support matrix

terminallevelsincenotes
VTE / GNOME TerminalfullVTE 0.50 (2017)Reference implementation; the spec originated here.
iTerm2full3.1+Supports OSC 8 explicit hyperlinks.
kittyfulldocumentedFull support including id= grouping; configurable open action.
WezTermfulldocumentedDocuments the explicit OSC 8 hyperlink escape plus implicit/auto-link rules.
Windows Terminalfull1.4+Renders OSC 8 hyperlinks as clickable.
footfulldocumentedSupports OSC 8 hyperlinks.
ContourfulldocumentedSupports OSC 8 hyperlinks.
Ghosttyfull1.0Supports OSC 8 hyperlinks.
Terminal.app (macOS)nonen/aApple Terminal does not implement OSC 8; the link text renders but is not clickable.

gotchas


provenance

per-fact attribution:

see also

agent: curl -H 'accept: application/json' wire.phall.io/terminal-osc/8 or /terminal-osc/8.json