Skip to content

Test: Hyperlink terminal sequences #161851

@Tyriar

Description

@Tyriar

Refs: #39278

Complexity: 2

Create Issue


The terminal now supports printing hyperlinks (text that points to a url) in the terminal. The full behavior is described at https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda (we do not support the id attribute though).

Essentially you echo the following:

\x1b]8;; <url> \x1b\ <label> \x1b]8;;\x1b\

Here's an example of how to write one in bash:

printf '\e]8;id=abc;http://example.com/\e\\This is a link中国\e]8;;\e\\\n'

There are some more examples here:

https://github.com/xtermjs/xterm.js/blob/37c722d556e4b7e15ef55b63da41a93f87ddd43c/demo/client.ts#L876-L894

It's fine to test either bash or zsh on macOS.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions