Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test: Hyperlink terminal sequences #161851

Closed
2 tasks done
Tyriar opened this issue Sep 26, 2022 · 5 comments
Closed
2 tasks done

Test: Hyperlink terminal sequences #161851

Tyriar opened this issue Sep 26, 2022 · 5 comments

Comments

@Tyriar
Copy link
Member

Tyriar commented Sep 26, 2022

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.

@TylerLeonhardt
Copy link
Member

It looks like this only works in Win11. I had @Tyriar run commands for me on his machine.... but I also verified this worked on macOS as well.

Oh also, PowerShell has a neat little feature:

PS > $PSStyle.FormatHyperlink("Hi friends!", "https://github.com/")

image

@autoantwort
Copy link

Why does this only works on Windows 11?

@Tyriar
Copy link
Member Author

Tyriar commented Oct 20, 2022

@autoantwort it needs support in conpty which is a feature that's shipped with Windows

@autoantwort
Copy link

Hm ok. Because Windows Terminal also supports hyperlinks on Windows 10

@Tyriar
Copy link
Member Author

Tyriar commented Oct 24, 2022

@autoantwort Windows Terminal builds and ships conpty as part of their application, this is something we've considered but it seems too expensive for us to do currently.

@github-actions github-actions bot locked and limited conversation to collaborators Nov 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants