OSC 8 — Inline hyperlink
Render clickable hyperlinks in terminal output (gnome-terminal 3.26+, iTerm2, Windows Terminal, kitty, ...).
Byte forms
Every common string-literal form so you can paste-and-search either direction.
\x1b]8;;URI\x07TEXT\x1b]8;;\x07\033]8;;URI\007TEXT\033]8;;\007\e]8;;URI\aTEXT\e]8;;\aESC ] 8 ; ; URI BEL TEXT ESC ] 8 ; ; BEL1b 5d 38 3b 3b ... 07 ... 1b 5d 38 3b 3b 07Description
Specified by gnome-terminal in 2017 and now widely adopted. Two-part sequence: `OSC 8 ; params ; URI BEL` opens a link region, `OSC 8 ; ; BEL` (empty URI) closes it. The middle TEXT can include any printable + further SGR. Optional params: `id=anchor` lets the terminal de-duplicate multi-line links. Plain HTTP/HTTPS URIs work everywhere; `file://` works in iTerm2 / wezterm / kitty / vscode-terminal; `vscode://` and editor URIs are supported by some.
Spec citation: Hyperlinks in terminal emulators (gnome-terminal proposal, 2017)
Examples
printf '\033]8;;https://example.com\033\\link text\033]8;;\033\\\n'print('\x1b]8;;https://example.com\x07link text\x1b]8;;\x07')fmt.Print("\x1b]8;;https://example.com\x07link text\x1b]8;;\x07\n")console.log('\x1b]8;;https://example.com\x07link text\x1b]8;;\x07')printf("\x1b]8;;https://example.com\x07link text\x1b]8;;\x07\n");Terminal support
- xterm
- partial
- Linux console (fbcon)
- no
- macOS Terminal.app
- no
- iTerm2
- yes
- Windows Terminal
- yes
- cmd.exe / ConPTY
- no
- kitty
- yes
- alacritty
- no
- WezTerm
- yes
- Ghostty
- yes
- GNOME Terminal
- yes
- Konsole
- yes
- tmux
- no
- GNU screen
- no
| xterm | Linux console (fbcon) | macOS Terminal.app | iTerm2 | Windows Terminal | cmd.exe / ConPTY | kitty | alacritty | WezTerm | Ghostty | GNOME Terminal | Konsole | tmux | GNU screen |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| partial | no | no | yes | yes | no | yes | no | yes | yes | yes | yes | no | no |
Related sequences
In the family cookbook
OSC cookbook · 3. OSC 8 hyperlinks — `\x1b]8;;URI\x07TEXT\x1b]8;;\x07`